How to debug a node.js app with Nova

Hey, I’m new to Nova and fairly new to node and I’m trying to debug a node.js app. I followed the instructions in the documentation on how to do this, however debugger and in app break points just aren’t getting hit.

I should say before I get into it, I’m not sure if this is a node or a Nova question!

I’ve create a really basic node app that’s just a server:

const http = require("http");
const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  console.log('test')
  debugger

  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

And I created a new Node.js Debug task in the project settings with Launch as the launch type. I hit the play button and it seems to run, but when I run the application from the terminal (either Nova’s or Terminal app) nothing happens:

Do I need to create an extra script somewhere to get it working?

Thanks!

Hi Jonno!

For help on how to use Nova itself, you can reach out to Panic directly to request support. This forum is intended for discussing issues with creating Nova extensions.

Since you’re here, the first thing I’d try is to specify the Script Path in the task configuration (likely app.js if you’re following Node’s Getting Started guide). I’d also get rid of the line above that just says debugger. You can add a breakpoint by clicking the line number where you want to pause.