pwa-kit
pwa-kit copied to clipboard
[FEATURE] Make nodejs inspect configurable
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'} : {})
}
}
)
})
This issue has been linked to a new work item: W-11911359
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.
@alexvuong Thx, I'm happy to hear, it will be investigated.
Did you consider to just change the start:inspect
script in your local project?
"start:inspect": "NODE_OPTIONS='--inspect=<yourIP>:<yourPort>' npm run start"
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.