I would like to debug server side code (+server.svelte) code in VS code but cannot work out how.
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
I would like to debug server side code (+server.svelte) code in VS code but cannot work out how.
2
Answers
Server-side debugging is possible, but not fully supported:
debugger
statements.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
Relying on
debugger
statements isn’t that great, but fortunately there is a better solution (using thenode-loader
module fromvavite
): https://www.codelantis.com/blog/sveltekit-server-debugging-vscode-webstorm