Skip to content

Web Socket (Socket IO) is not working with NextJS 13.5 #56996

@yousihy

Description

@yousihy

Link to the code that reproduces this issue

https://github.com/AntonioErdeljac/next13-discord-clone

To Reproduce

  1. Clone the tutorial https://github.com/AntonioErdeljac/next13-discord-clone
  2. Upgrade NextJS to the latest version
  3. You will start getting the error:

Error handling upgrade request TypeError: Cannot read properties of undefined (reading 'bind') at DevServer.handleRequestImpl

The SoketIO will not connect. You can only fix this error if you downgrade to 13.4.12

Once you downgrade, your client will be able to establish the connection successfully

Current vs. Expected behavior

Client should be able to connect using Web Socket (SocketIO). However, we are getting the below error when using the latest NextJS version:

Error handling upgrade request TypeError: Cannot read properties of undefined (reading 'bind') at DevServer.handleRequestImpl

NextJS 13.4.12 version seems to be working fine.

Verify canary release

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

Provide environment information

Operating System:
      Platform: win32
      Arch: x64
      Version: Windows 10 Enterprise
    Binaries:
      Node: 18.18.1
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.12
      eslint-config-next: 13.0.0
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 4.9.5
    Next.js Config:
      output: N/A


warn  - Latest canary version not detected, detected: "13.4.12", newest: "13.5.6-canary.6".
        Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
        Read more - https://nextjs.org/docs/messages/opening-an-issue

Which area(s) are affected? (Select all that apply)

App Router, Middleware / Edge (API routes, runtime), Package manager (npm, pnpm, Yarn)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    RuntimeRelated to Node.js or Edge Runtime with Next.js.bugIssue was opened via the bug report template.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions