question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debug Server Side code using --inspect

See original GitHub issue

It would be nice to have an option to enable node debugging for server-side code to be able to stop on breakpoints inspect variables and etc.

Proposed syntaxis is:

svelte-kit dev --inspect

Currently, it’s possible to start debugger using:

 "dev": "NODE_OPTIONS=\"--inspect\" svelte-kit dev"

This enables inspecting and i successfully connected to the nodejs using Chrome Dev Tools. But looks like server-side code generated without source maps and it makes it impossible to put breakpoints inside IDE such as Vs Code or Webstorm (they just ignore breakpoints and execute code without stop).

So when --inspect option is set we should pass through this flag to nodejs and enable sourcemaps in all transpilers/vite

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:53
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

20reactions
alexbjorligcommented, May 20, 2021

I know it’s normally not very nice to add a comment about +1. But I must emphasize how absolute critical debugging is for the developer experience. @thekip is there something I can help with to help with this?

4reactions
thekipcommented, Feb 22, 2022

Debugging with “debugger;” statements was always possible, problem with debugging using breakpoints in ide. The main benefit of IDE breakpoints vs “debugger;” statements you don’t need to stop and rebuild/reload current file and don’t loose a debugging context.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To: Debugging server-side code · Reaction Docs
Inspecting in Webstorm · Select your breakpoints by clicking along the left-hand side line numbers. · Click on the Debug icon to start...
Read more >
Testing and Debugging your Local Backend | Mobify DevCenter
Using ssr:inspect to debug with breakpoints. With a simple command, you can use Chrome DevTools to debug the local backend of your server-side...
Read more >
6 Server-Side Debugging Tips That Make Developing Easier
Check out these six tips for ways to improve your server-side debugging with ASP.NET.
Read more >
Debugging - Getting Started - Node.js
When started with the --inspect switch, a Node.js process listens for a debugging client. By default, it will listen at host and port...
Read more >
How to Debug Server Side Rendering - Bitovi
If you've run donejs add vscode , you'll see a .vscode folder with a launch.json file inside, which means you're ready to start...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found