Skip to content

Debug Server Side code using --inspect #1144

@timofei-iatsenko

Description

@timofei-iatsenko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions