Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99142

debugging next.js with vscode debugger

$
0
0

I have installed a project using create-next-app. I need to debug the server side rendering using my editor: vscode. So i have visited vscode-recipes - how to debug next.js app.

I have made a slight change to the recipe so I won't have to install Next globally.

that's my launch.json config file:

    {
      "type": "node",
      "request": "launch",
      "name": "Next: Node",
      "runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
      "runtimeArgs": ["-inspect"],
      "port": 9229,
      "console": "integratedTerminal"
    }

While i'm running it I get the following error:

Error: Use env variable NODE_OPTIONS instead: NODE_OPTIONS="--inspect" next dev

I'm trying to change runtimeArgs to following command that should work: "runtimeArgs": ["NODE_OPTIONS=--inspect"] and I am getting other error:


No such directory exists as the project root: /Users/username/with-redux-thunk-app/NODE_OPTIONS=--inspect

How I can I correctly express "NODE_OPTIONS=--inspect" so it works with vscode debugger?


Viewing all articles
Browse latest Browse all 99142

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>