-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
Hello,
I use VS Code and run npm run dev in the Debug: 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:
interface Props {
queryState?: Partial<QueryState>
}
let {
queryState = $bindable({}),
}: Props = $props()if I have a breakpoint to be able to see the value of queryState, I cannot do this in Svelte 5 but rather get:
queryState
ƒ (value, mutation) {
if (arguments.length > 0) {
if (!runes || !mutation || legacy_parent || is_store_sub) {
setter(mutation ? getter() : value);
}
return value;
} else {
return getter();
}
}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/ts files. 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
System:
OS: Windows 11 10.0.26100
CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H
Memory: 7.19 GB / 31.69 GB
Binaries:
Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (133.0.3065.69)
Internet Explorer: 11.0.26100.1882Severity
blocking an upgrade