Skip to content

ParseError: Unexpected end of input #6923

@brgrz

Description

@brgrz

Describe the bug

Compilation error ParseError: Unexpected end of input happens when you have a Svelte component with the following contents:

<script lang="ts">
	import '../app.css';
</script>

<!-- <style lang="scss"> -->
<style>
    /* :global {
		@import './lib/shared/drawer/Drawer.css';
	} */

	:global(body) {
		padding: 1rem;
	}

</style>

The issue here is the commented line <!-- style lang="scss"> -->. If this line is removed compilation error is gone.

I often comment out parts of markup when working and continously run into this issue.

Reproduction

<script lang="ts"> import '../app.css'; </script> <style> :global(body) { padding: 1rem; } </style>

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19042
    CPU: (8) ia32 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 3.61 GB / 15.78 GB
  Binaries:
    Node: 14.17.0 - C:\Program Files (x86)\nodejs\node.EXE
    npm: 7.22.0 - C:\Program Files (x86)\nodejs\npm.CMD
  Browsers:
    Chrome: 95.0.4638.69
    Edge: Spartan (44.19041.1266.0), Chromium (95.0.1020.44)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    svelte: ^3.43.1 => 3.43.1

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions