Skip to content

Svelte 5 - VSCode Debugger reading rune values #15422

@kerem-coemert

Description

@kerem-coemert

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.1882

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions