question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] Make nodejs inspect configurable

See original GitHub issue

Is your feature request related to a problem? Please describe. Currently nodejs inspect can not be configured. It starts default with 127.0.0.1:9229. But if you run the frontend in a docker container, you can not reach it. The IP must be changed into 0.0.0.0 to make it works. This is currently not possible. Or if you have a second app already running which is using 9229, then we have no possibility to change the port for inspect.

Describe the solution you’d like Please add to pwa-kit-dev start command two new parameters like inspectIP and inspectPort

Describe alternatives you’ve considered Found no alternatives.

Sample

program
        .command('start')
        .description(`develop your app locally`)
        .addOption(
            new program.Option('--inspect', 'enable debugging with --inspect on the node process')
        )
        .addOption(new program.Option('--noHMR', 'disable the client-side hot module replacement'))
        .action(({inspect, noHMR}) => {
            execSync(
                `node${inspect ? ' --inspect=0.0.0.0:9229' : ''} ${p.join(process.cwd(), 'app', 'ssr.js')}`,
                {
                    env: {
                        ...process.env,
                        ...(noHMR ? {HMR: 'false'} : {})
                    }
                }
            )
        })

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
alexvuongcommented, Oct 14, 2022

Thank you for raising this issue! This is a reasonable ask. We will take this up with the team and add it to our capacity when it is available.

0reactions
nx-renezwingecommented, Nov 17, 2022

Did you consider to just change the start:inspect script in your local project?

"start:inspect": "NODE_OPTIONS='--inspect=<yourIP>:<yourPort>' npm run start"

Hi @muenzpraeger, i copied the command out of the script

cross-env NODE_ICU_DATA=node_modules/full-icu node --inspect=0.0.0.0:9229 app/ssr.js

But your hint with the node options env var is much cleaner, i will try it out. Thx.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging - Getting Started - Node.js
Create a new Node.js debug configuration and hit Debug. --inspect will be used by default for Node.js 7+. To disable uncheck js.debugger ...
Read more >
Debug Node.js Apps using Visual Studio Code
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >
Running and debugging Node.js | WebStorm Documentation
Create a Node.js run/debug configuration · From the main menu, select Run | Edit Configurations. · Specify the Node. · In the JavaScript...
Read more >
Debugging and profiling Node.js applications - IBM Developer
Discover how to perform source-level debugging on your Node.js ... The command to run Node debugging client is: node inspect node_module .
Read more >
How to Debug Node.js Code Using Multiple Tools - Kinsta
This tutorial demonstrates various tools to debug node applications and find their root causes. Dig in and learn from the ground up.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found