-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Svelte VS Code extension keeps crashing (TypeError: Cannot read properties of undefined (reading 'sourceFile')) #2228
Comments
This actually happens to any projects with Another problem is why your tsconfig gets updated as soon as your language server is started. I only get it to crash every time I save the tsconfig/jsconfig. Wondering if that will cause any performance problems. Do you keep restarting the dev server? If not, Can you provide a reproduction repository so we can check why the tsconfig consistently got updated? I think it might also not be related to the npm workspace, So can you try to provide a repo without it? |
Thanks @jasonlyu123 for quick response. If I understand correctly what you're asking: once I see that crash error message toast in vs code I always restart the Svelte language server (but not the vite dev server), and I also obviously regularly restart the dev server as well, although not after each crash... But I almost never edit My suspicion to npm workspaces was because I have tens of Svelte projects on my machine, but only the one with workspace is crashing. I'll try to prepare the reproduction repo soon. Thanks. (And yes, I'm using the |
If you did actually restart the Vite server five times in 3 minutes, then we don't need a reproduction. SvelteKit will override the tsconfig file when the dev server starts. I just wanted to make sure if it's something that will overwrite the file repeatedly. Also, I found that the problem that caused the crash was tracked in #1965, which is a hard problem to solve. So if you did manually restart that many times, I am going to close this, and let's track the issue in #1965. |
OK, I see what you mean - no, I didn't restart the dev server that much. When I said "regularly", that is, maybe, once in an hour (depends on many things)... |
I had a similar problem with svelte when I tried to open an external one and not one created by me. I fixed it by replacing the folder called "nodes_module" with one that was created by my macbook. Maybe that can work out for you as well :) |
Having this same issue with it crashing. It does seem to come up more often if I am copy pasting large amounts of code at once. Also doesn't seem to like when I try to import things. |
Describe the bug
VSCode Svelte Extension keeps crashing on a npm workspaces based Sveltekit typescript project. On other non workspaces Svelte/kit projects it seems to be running fine.
I'm seeing this (or very similar) error output:
Reproduction
Create a npm workspace project with 2 workspaces where one is a Sveltekit typescript "library" project (a) and the other is a regular Svelte typescript (non sveltekit) project (b) where "b" is dependant on "a" (the non-kit "b" imports the lib from "a").
Expected behaviour
No crashing.
System Info
VSCode report:
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: