Skip to content

Commit

Permalink
fix(debugging): do not pass NODE_OPTIONS='--inspect' to subprocesses
Browse files Browse the repository at this point in the history
fixes #11030
  • Loading branch information
vvo committed Mar 19, 2020
1 parent 756b365 commit adf7a30
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/next/server/next-dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ export default class DevServer extends Server {
{
maxRetries: 0,
numWorkers: this.nextConfig.experimental.cpus,
forkOptions: {
env: {
...process.env,
// discard process.env.NODE_OPTIONS --inspect flag otherwise two debuggers are started in inspect
// mode when users will try to debug their Next.js application with NODE_OPTIONS='--inspect' next dev
NODE_OPTIONS: process.env.NODE_OPTIONS
? process.env.NODE_OPTIONS.replace('--inspect', '')
: '',
},
},
}
) as Worker & {
loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths
Expand Down

0 comments on commit adf7a30

Please sign in to comment.