next.js: Upgrade next from 13.4.3 to 13.4.4 startup crash, because of websocket error in dev mode due to NODE_OPTIONS='--inspect'

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103
    Binaries:
      Node: 19.6.0
      npm: 9.4.0
      Yarn: 1.22.19
      pnpm: 8.4.0
    Relevant packages:
      next: 13.4.5-canary.0
      eslint-config-next: 13.4.4
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.0.4

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/julianklumpers/reproduction-app

To Reproduce

  • yarn dev
  • npm run dev
  • pnpm dev

Describe the Bug

In the release log of 13.4.4 is a commit that says NODE_OPTIONS='--inspect' is fixed, see:

Passing NODE_OPTIONS='--inspect' causes a websocket error and the app cannot start.

Expected Behavior

Running dev with NODE_OPTIONS=‘–inspect’ starts the app without websocket error and inspect mode works correctly.

Which browser are you using? (if relevant)

Google Chrome Version 113.0.5672.92

How are you deploying your application? (if relevant)

Digital Ocean

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 20
  • Comments: 20 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I’m starting with NODE_OPTIONS='--inspect' next dev and still see the error as at 13.4.4 when I navigate to http://localhost:3000 - WebSockets request was expected

Debugger listening on ws://127.0.0.1:9229/fedf6935-9af5-42cf-bfc4-3914287169bf
...
- ready started server on 0.0.0.0:3000, url: http://localhost:3000
Debugger listening on ws://127.0.0.1:62395/f269290f-eb18-45bc-93cf-f528594a995d

Connecting my node debugger to 9229, logs this message: - ready started server on 0.0.0.0:3000, url: http://localhost:3000

Looks like maybe websockets are expected for both ports - 9229 and 62395?

I can confirm I could replicate, was just a matter of passing NODE_OPTIONS='--inspect' to my startup script.

Same problem in our company since we upgrade to 13.4.4 version 😭

@cray2015 This issue should be fixed in the next release or above version v13.4.8-canary.3

Could be related, but I’m seeing this after upgrading from 13.4.3 to 13.4.4:

- error uncaughtException: TypeError: Cannot read properties of undefined (reading 'length')
    at WasmHash._updateWithBuffer (/Users/anandchowdhary/Projects/1q/node_modules/.pnpm/next@13.4.4_@babel+core@7.22.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:1352524)
    at WasmHash.update (/Users/anandchowdhary/Projects/1q/node_modules/.pnpm/next@13.4.4_@babel+core@7.22.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:1351859)
    at BatchedHash.update (/Users/anandchowdhary/Projects/1q/node_modules/.pnpm/next@13.4.4_@babel+core@7.22.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:1348216)
    at /Users/anandchowdhary/Projects/1q/node_modules/.pnpm/next@13.4.4_@babel+core@7.22.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:292480
    at processQueue (/Users/anandchowdhary/Projects/1q/node_modules/.pnpm/next@13.4.4_@babel+core@7.22.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/webpack/bundle5.js:28:1365665)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

@Cow258 Thanks for the fix and information, really appreciate 🙏

Just upgrade to 13.4.5

same error in my mac. i cannot inspect server-side code. the command NODE_OPTIONS='--inspect' next dev does not seem to work in the current version of next 13. any suggestions from the development team?