Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully support "NODE_OPTIONS='--inspect' next" #12143

Closed
josias-r opened this issue Apr 23, 2020 · 3 comments
Closed

Fully support "NODE_OPTIONS='--inspect' next" #12143

josias-r opened this issue Apr 23, 2020 · 3 comments

Comments

@josias-r
Copy link

Node has this great feature for debugging inside a webkit inspector (for example to console log complete objects) using the NODE_OPTIONS env variable.

Unfortunately, there seem to be multiple node processes running during development. My start scripts look like this NODE_OPTIONS='--inspect' next and it works to the level of console logging everything inside my next.config.json to a webkit console.

What I would prefer though, if I could inspect my functions that are run from getStaticProps for example. Unfortunately, this is not possible, because that's a different node process and the same port can't be reused (I also get a warning regarding that inside my console).

It would be nice to have some option to set the NODE_OPTIONS individually, or you could internally possibly pass the console logs along to the other node process?

Nothing of high priority, but it would be neat to have :D

@josias-r
Copy link
Author

josias-r commented Apr 23, 2020

I feel really stupid now, but after some more investigation I just found out, there is a "fix". You can set "NODE_OPTIONS='--inspect=0' next" (notice the "=0") and it will assign random ports. This is a bit annoying as you need to add the new ports manually after every start again, but its the best workaround I currently know ^^

EDIT: I was able to connect to the second node process, but it doesn't seem to be the one from server-side methods like getStaticProps, I don't know if it's possible for that :(

@timneutkens
Copy link
Member

This was fixed by #10807

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants