-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Feature request: friendlier error for empty bracket pair in template instead of full js_parse_error
being thrown.
#1069
Comments
Throwing a different error would not help. The error would still be thrown in the same way by |
I don't think we should change anything here |
Agreed...the only thing i could see feasible is maybe an option for vite-plugin svelte Also i can't transfer it there 😄 |
I'm gonna go ahead and close this - yes it's a big error but it's very detailed, and forgetting content in your braces does not happen that often |
I would not have made this issue if it didn't happen that often. But ok. |
hmm, vite plugin svelte should format the frame and message more nicely on the console. sveltelab repro: https://www.sveltelab.dev/o2e6wq4d900igtk did something change with CompileError recently? |
This has been a thing for months. Maybe the example I provided has changed recently, but I have been seeing this happen for a while now. |
lets see if we can make the terminal output nicer again. It's correct that the svelte error contains the full information but we shouldn't put json on the console like that |
Thanks for looking into this ❤️ |
Describe the problem
When working in large svelte components in svelte kit, the console is flooded with the entire components json representation when a is_parse error is thrown by the compiler caused by a simple empty bracket pair:
https://svelte.dev/playground/0a51fe6115b34b4a80268714337994b5?version=5.18.0
look at the size / position of my scrollbar:
Describe the proposed solution
A custom error for this edge case, just saying "empty brackets not allowed in template.", or have it just strip it during compilation instead of throwing.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: