sites icon indicating copy to clipboard operation
sites copied to clipboard

Show special error when a compiled Svelte component results in a syntax error

Open Conduitry opened this issue 6 years ago • 3 comments
trafficstars

If the Svelte compiler produces syntactically incorrect output, the error that the REPL currently displays in "Unexpected token (Note that you need plugins to import files that are not JavaScript)", which is a bit misleading. I think we could detect when this happens and display a more helpful error, something along the lines that the compiler has produced invalid output, and to please open an issue with a minimal reproduction.

The REPL has complete control over the bundling process, and knows exactly which Rollup plugins are in use, so I think we should be able to treat all such errors arising from .svelte files as being situations to display a new error message,

Conduitry avatar Jul 20 '19 19:07 Conduitry

I'm getting "Unexpected token" but since it doesn't say which line the problem is on, I have to hunt for it.

rlaferla avatar Feb 09 '20 01:02 rlaferla

I think #173 is related as a full stack trace would probably also help in making compilation errors easier to troubleshoot.

janosh avatar Apr 27 '22 09:04 janosh

Related issues: #335 , #354

gyurielf avatar Sep 19 '22 09:09 gyurielf