The ndb
method from the docs didn't work on my machine either, so I just do it old school.
In package.json
, we learn that npm run dev
actually runs sapper dev
.
The sapper
executable is located in your node_modules/.bin
directory and, like most cli in js packages, can be run with node like this: node node_modules/.bin/sapper
.
We can add the --inspect
or --inspect-brk
flag to node to launch the debug server:
node --inspect-brk node_modules/.bin/sapper dev
Great, now you need to fire the node's debugger. Easiest way to do that is to launch Chrome (yes the browser), open the dev tools on any page that you have in there, and click the little green nodish icon that has appeared in the dev tools:
The node debugger will pop up, and then... Debug!
(Maybe start with some debugger
keywords, 'cause breakpoint tends to be very flaky in this tool...)