Next.js: How to debug with customized koa backend?

Created on 4 Dec 2017  路  2Comments  路  Source: vercel/next.js

I don't found anything about debug backend with dev mode.

Now I can only run npm run build, and npm run start to debug the app.
It is very slowly and inefficiency.

Is there any way to run npm run dev with customized backend enabled?
I test and find npm run dev not start customized backend as expect.

Most helpful comment

https://nodejs.org/en/docs/inspector/

Run your app with --inspect flag and use chrome://inspect to connect Chrome to your app to debug backend logic

All 2 comments

https://nodejs.org/en/docs/inspector/

Run your app with --inspect flag and use chrome://inspect to connect Chrome to your app to debug backend logic

In the custom-koa-server example, package.json is modified to start it by calling node server.js. You should be able to add --inspect to that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pie6k picture pie6k  路  3Comments

kenji4569 picture kenji4569  路  3Comments

knipferrc picture knipferrc  路  3Comments

lixiaoyan picture lixiaoyan  路  3Comments

swrdfish picture swrdfish  路  3Comments