-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Unexpected character @ #13856
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
Comments
This is most likely because you updated from Svelte 4 to Svelte 5 and the language server still has the cache from loading the Svelte 4. In that case, just restart the editor. Another possibility is that you have workspace trust set to untrust. In that case, the local Svelte 5 compiler won't be loaded and you'll have to trust the workspace for it to work. |
Yes, that's exactly what I did, I updated from svelte 4 to svelte 5 (restarting editor didn't work tho, maybe I will need to delete some stuff) Thanks for this, I will do your suggestion later, but will mark this as closed. thanks man @jasonlyu123 |
@DDuran19 are you using Houdini graphql client? If so you need to update it to the latest version or at least until svelte 5 support was added. I was also receiving this error. If you comment it out in your vite config plugins that error would go away |
@DDuran19 you should not have marked this as completed as this is an issue with the language tools (VSCode Plugin) It has now been reported here: sveltejs/language-tools#2557 (comment) |
As previously mentioned, this usually is because the language server already loaded the compiler from svelte 4. You just need to restart the editor in this case. We'll look into sveltejs/language-tools#2557 separately. Please be patient. |
Hey sorry man, been busy with lots of things. My issue was eventually fixed by deleting .svelte-kit, .vscode and node modules (restarting vscode didnt work for me) I guess its because of cache thing like what they say. Perhaps an improvement could be made such that on upgrade, it invalidates the cache.. not sure how to implement it |
If you need to delete node_modules or lock file that is more likely because some of the packages only accept svelte 4 so you didn't actually successfully update to svelte 5. "Cache invalidation" won't help in this case. |
Not Actually sure if I had to honestly, I didn't test it one at a time, I just gave it a go. but on another project, I just tried, I only needed to delete .svelte-kit and restart vscode but I always put overrides on my package json cause of the conflicts with other dependencies |
@justingolden21, your case is likely sveltejs/language-tools#2557 (linked above). If you're not using SvelteKit like sveltejs/language-tools#2557, you can create a jsconfig.json with something like this {
"compilerOptions": {
"moduleResolution": "bundler",
"target": "ESNext",
"module": "ESNext",
"verbatimModuleSyntax": true,
"isolatedModules": true
},
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
} |
@jasonlyu123 thank you! sveltejs/language-tools#2557 (comment) worked great for me. Lifesaver! |
Describe the bug
I am getting this error
Unexpected character '@'svelte(parse-error)
when using @render I am not sure if this is svelte5 problem or probably my IDE, or extension? please help...Reproduction
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: