-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Svelte 5 - VSCode Debugger reading rune values #15422
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
So the problem here is that you are debugging the compiled code which is different since the compiler does some heavy lift...not sure really what we can do here. As a workaround for the moment you can take a look at how svelte is interacting with it...in this specific case you can just call |
I understand, that's unfortunate. Because in this case I think this would be a regression with the introduction of runes, because in Svelte 4 I could definitely use the debugger in this manner without problems (even by changing values through it and seeing how the rest of the code reacts after the breakpoint). |
I think this should be handled by the official svelte-code extension. I opened a request and made a workaround (in the request) sveltejs/language-tools#2703 |
Perfect, thank you! Looking forward to the PR being merged. |
Describe the bug
Hello,
I use VS Code and run
npm run dev
in theDebug: JavaScript Debug Terminal
as suggested for Svelte. This has been working really well until now, but lately with my migration to Svelte 5 I have the following problem:Reproduction
I have a
.svelte
file that has something like:if I have a breakpoint to be able to see the value of
queryState
, I cannot do this in Svelte 5 but rather get:get(queryState)
or ,$inspect(queryState)
,$state.snapshot(queryState)
does not work either (in the latter case, I even get:The
$staterune is only available inside
.svelteand
.svelte.js/tsfiles
. What to do here? What is the recommended way to use the VSCode Debugger with Svelte 5? Thank you!The only workaround that I have found is to run
JSON.parse(JSON.stringify($$props.queryState))
in the debugger, which really sucks.Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: