Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Conduitry opened this issue Jul 20, 2019 · 3 comments
Labels

Comments

@Conduitry
Copy link
Member

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,

@rlaferla
Copy link

rlaferla commented Feb 9, 2020

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

@Rich-Harris Rich-Harris transferred this issue from sveltejs/svelte-repl Dec 16, 2021
@janosh
Copy link
Contributor

janosh commented Apr 27, 2022

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

@gyurielf
Copy link

Related issues: #335 , #354

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants