-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
Description
Describe the bug
an empty javascript comment block /**/ can cause the svelte compiler to lock up.
Reproduction URL
edit to add simplified reproductions:
- https://svelte.dev/repl/eb69a98e8d4b4825ba391aa41d19d3ba?version=4.2.2
- https://stackblitz.com/edit/vitejs-vite-y6kzgx?file=src%2Froutes%2FCounter.svelte&terminal=build
Reproduction
- If you run
npm run build -- -d, the build will complete successfully. - If you remove the block comment on line 180 of Counter.svelte and run the same command again, the build will deadlock after ssr compile.
- The cause is that if you change the last block comment on line 179. add an additional block comment or input something in comment, the build will complete successfully again.
The file contains three instances of code that is identical to the code on line 179.
There are no problems with any of the other lines.
The issue was not reproduced in a Vite fork.
It's odd that a bug could be caused by comments, but it's possible that there's a conflict between Svelte Kit and a Vite plugin.
Logs
✓ 152 modules transformed.
vite:vite-plugin-svelte:stats ssr compile done.
vite:vite-plugin-svelte:stats package files time avg
vite:vite-plugin-svelte:stats css-lube-docs 51 0.53s 10.3ms
vite:vite-plugin-svelte:stats lube-ui 10 70.6ms 7.1ms +0msSystem Info
System:
OS: Windows 10 10.0.22621
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 1.60 GB / 7.73 GB
Binaries:
Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.9.2 - ~\AppData\Roaming\npm\pnpm.CMD
Browsers:
Edge: Spartan (44.22621.2134.0), Chromium (118.0.2088.61)
Internet Explorer: 11.0.22621.1
npmPackages:
@sveltejs/adapter-static: ^2.0.3 => 2.0.3
@sveltejs/kit: ^1.26.0 => 1.26.0
svelte: ^4.2.2 => 4.2.2
vite: ^4.5.0 => 4.5.0Reactions are currently unavailable