-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Astro language server crashes with conditional <script> tag #636
Comments
I cannot reproduce a crash with the snippet you shared, do you have another example? It not formatting is a known issue: withastro/prettier-plugin-astro#337 |
I had a similar issue when the copilot provided incomplete tags For example:
At this point, copilit had not finished the code completion but the Astro server crashed 5 times:
|
That one is #623 |
Closing due to inactivity, please open a new issue if this still happens. I still cannot reproduce personally! |
What version of
astro
are you using?2.10.13
Are you using an SSR adapter? If so, which one?
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Safari
Describe the Bug
I am running into a problem where the Astro language server (using the Astro plugin in VS Code) crashes with code like in the following example:
In this example I want to add this script to the page whenever some conditions (now simplified into
true && ...
) are true.Prettier starts giving errors like:
and I received a popup that the Astro language server crashed continuously, so the plugin was disabled.
However, when you take the script out of the conditional rendering block (like the example below), it gets formatted fine, and works correctly.
Where does this problem come from and how can it be solved?
It looks like it has something to do with the
{
in thefbq
function. As if there are now too many{
's for the language server to handle.What's the expected result?
The first example to be formatted correctly by Prettier, and not crash the Astro language server.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-z8gtaw?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: