sites
sites copied to clipboard
Show special error when a compiled Svelte component results in a syntax error
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,
I'm getting "Unexpected token" but since it doesn't say which line the problem is on, I have to hunt for it.
I think #173 is related as a full stack trace would probably also help in making compilation errors easier to troubleshoot.
Related issues: #335 , #354