Open DetachHead opened 1 year ago
This is an issue in Vite: https://github.com/vitejs/vite/issues/3288
I think this issue can be closed.
The linked Vite issue (https://github.com/vitejs/vite/issues/3288) has been closed.
The original example works, the debugger
statement is presented in the source file by VSCode.
I've also created a skeleton SvelteKit project configured to generate and auto-load source maps: https://github.com/giacomoran/sveltekit-source-maps
It looks to me like @giacomoran was able to get this working with the following in package.json
:
"preview": "NODE_OPTIONS=--enable-source-maps vite preview",
And the following in vite.config.js
:
build: {
sourcemap: true,
},
Perhaps we need to update https://kit.svelte.dev/docs/debugging with these steps
I added a demo: https://github.com/theetrain/7320-svelte-server-debugging
Despite following https://github.com/sveltejs/kit/issues/7320#issuecomment-1883789360, I could not get breakpoints to work within src/routes/+page.server.js@load
.
The source maps appear in Chrome Dev tools when I manually add the repository to the "sources" workspace, but breakpoints in server-side files won't trigger. Not sure what I'm missing.
Scratch that, I forgot to add --inspect
and to launch the Node debugger, and it works! I can probably resolve this in the docs.
Describe the bug
source maps don't seem to work on server-side code.
i enabled them in like 4 different spots because i have no idea which one is supposed to work:
svelte.config.js
vite.config.ts
tsconfig.json
to reproduce
npm install && npm run dev
the![image](https://user-images.githubusercontent.com/57028336/196857559-3801f84b-63c8-4ebd-8190-c19e8a57ea05.png)
debugger
statement is hit but the compiled js is displayed instead of the source code:Reproduction
https://github.com/DetachHead/sveltekit-issue
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response