Open nolanlawson opened 1 year ago
While HTML comments work in JS historically for compat, the JS expression block should technically contain only JS and comments would be /* comment */
instead. So I'm not sure if this should work.
I'm not sure either, but I'm just pointing out it's not a great user experience to 1) have the dev server crash entirely, with 2) no clear error message and no syntax highlighting indicating the error.
can I be assigned for this
Update: the error message is still the same (and confusing), but syntax highlighting now has a small hint of the error:
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Using an HTML comment inside of a JS expression inside of a template:
...causes a crash for both
astro dev
andastro build
:In VS Code at least, there's no indication of a syntax error, so this can be tricky to debug.
What's the expected result?
Ideally it would "just work" (it seems like a common thing to do when writing Astro templates), or it would provide a more helpful error message rather than a crash.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-kgdcfp?file=src%2Fcomponents%2FCard.astro
Participation