Closed nsivertsen closed 6 years ago
I'm afraid I can't get this to work at all :( ndb npm run dev
opens ndb, but doesn't start Sapper. I'm on the latest version of ndb. Is there a step that I'm missing?
That's strange, the only steps I've taken are npm install -g ndb
and ndb npm run dev
. I must say though that ndb occasionally shows aberrant behaviour. The first few days of use it had a dark theme, now it has a light theme, without me changing any settings or doing an update. And sometimes it takes a few starts to get it to work.
When you go to http://localhost:3000, does the tab hang or do you get an ERR_CONNECTION_REFUSED
error? Did you insert any debugger
statements anywhere in your code?
What happens if, after opening ndb, you click npm run dev
in the list of npm scripts in the bottom left panel?
A-ha! I think it's just a lot slower to start up sometimes, which made me think it wasn't working at all. The answer was to just have a bit more patience. It works — sourcemaps and everything. I added a console.log('here')
inside a template, and it showed up...
...and clicking index.html:7
took me right to the correct place in the template:
This is pretty damn cool!
I added a note about the slow startup time, in case other people are as impatient as me and also assume it's broken. Thank you!
Glad to hear you got it working! And my pleasure!
I'm not sure whether this really belongs here, but debugging has come up a few times in chat and I've found it quite valuable.
I'm not sure whether this works with Webpack. I'm guessing sourcemaps for Webpack need to be enabled in sapper-template rather than directly in Sapper as is the case for Rollup?