Skip to content

Commit

Permalink
test: ability to use node debugger (#56277)
Browse files Browse the repository at this point in the history
Fixes ability to run `NODE_OPTIONS='--inspect' next dev` as described in
[docs](https://nextjs.org/docs/pages/building-your-application/configuring/debugging),
by removing inspect option from NODE_OPTIONS arg passed to worker
process.

This bug seem to have been introduced in
7d93808 as a part of a some
refactoring. See how `getNodeOptionsWithoutInspect` is no longer used.

Fixes #55862

---------

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
  • Loading branch information
tomfa and huozhi authored Dec 7, 2023
1 parent a578cc8 commit e1fe0c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/integration/cli/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,18 +530,24 @@ describe('CLI Usage', () => {
test("NODE_OPTIONS='--inspect'", async () => {
const port = await findPort()
let output = ''
let errOutput = ''
const app = await runNextCommandDev(
[dirBasic, '--port', port],
undefined,
{
onStdout(msg) {
output += stripAnsi(msg)
},
onStderr(msg) {
errOutput += stripAnsi(msg)
},
env: { NODE_OPTIONS: '--inspect' },
}
)
try {
await check(() => output, new RegExp(`http://localhost:${port}`))
await check(() => errOutput, /Debugger listening on/)
expect(errOutput).not.toContain('address already in use')
} finally {
await killApp(app)
}
Expand Down

0 comments on commit e1fe0c9

Please sign in to comment.