-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Documentation on how to debug frontend and backend code with source maps #7781
Comments
Agree this would be a big plus. Looks like the vite change that was supposed to unblock #1144 hasn't gone through - vitejs/vite#3928 |
Upvoting this, truly essential. |
Oh yes this is a big need for SvelteKit |
Someone posted this workaround on Reddit (but I haven't been able to get it to work. Maybe a Windows+git bash issue?). |
Looks like the vite issue has been gone through if I inspected it correctly. What is the state of this issue at the moment? I really would love to get this working with sveltekit without the help of any third party tool - this should be a core functionality. |
This is currently possible in VSCode with the following {
"version": "0.2.0",
"configurations": [
{
"name": "Launch server",
"request": "launch",
"runtimeArgs": ["dev"],
"runtimeExecutable": "pnpm",
"skipFiles": ["<node_internals>/**"],
"type": "node",
"console": "integratedTerminal"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch browser",
"url": "http://127.0.0.1:5173",
"webRoot": "${workspaceFolder}"
}
],
"compounds": [
{
"name": "Both",
"configurations": ["Launch server", "Launch browser"]
}
]
} Replace Running 'Both' will open Chrome and run your Node.js/Vite server in debug mode, allowing you to add breakpoints for all client and server code, including JS code within |
@theetrain that only works for client-side debugging, but not for server-side code, for example inside a |
It works on server side if you put 😭😭😭 |
For me this launch.json works for client- and server-side debugging simultaneously 😊 Thanks! |
Describe the problem
I'm trying to setup a full stack debugging environment for SvelteKit.
I'm using the following
launch.json
and I'm starting the server withNODE_OPTIONS='--inspect' vite dev
but I'm unable to hit any breakpoints.See Code
If I manually insert some
debugger
statements, I end up in the generated chunk js and the source maps do not seem to apply properlyThere also seem to be many different options to enable source map generation. I'm having a hard time understanding which option will affect what files.
svelte.config.js
vite.config.ts
tsconfig.json
Describe the proposed solution
Something like https://nextjs.org/docs/advanced-features/debugging that explains how you can debug your SvelteKit frontend and backend code with full source maps support using either the VS Code debugger or Chrome DevTools.
Alternatives considered
I've found a few different sources for how to set up debugging:
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: