skip to Main Content

I would like to debug server side code (+server.svelte) code in VS code but cannot work out how.

2

Answers


  1. Server-side debugging is possible, but not fully supported:

    • You can trigger the debugger with debugger statements.
    • Or breakpoints in the compiled code.
    • Breakpoints in uncompiled Svelte/TS source files will not work because of a Vite issue with sourcemaps.

    You need to attach the VS code debugger to the SvelteKit dev server. This is one way to do this: https://app.arcade.software/share/RIrEisEk7V36paQmqtNI

    Login or Signup to reply.
  2. Relying on debugger statements isn’t that great, but fortunately there is a better solution (using the node-loader module from vavite): https://www.codelantis.com/blog/sveltekit-server-debugging-vscode-webstorm

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search