alamorre/nextjs-websocket

No export named Websocket (should import WebSocket instead); Socket URL doesn't work

Opened this issue · 1 comments

Thanks for this package. A couple quick ones:

  1. The import Websocket in the readme.md looks like it should be WebSocket
  2. Before next.js, the URL I passed to the WebSocket component was:
const devMode = !process.env.NODE_ENV || process.env.NODE_ENV === 'development'
const url = devMode ? 'ws://localhost:3000' : 'wss://www.mywebsite.com'

This works when running locally, but doesn't seem to work when deployed - any ideas? Thanks!

I am also facing the same issue.
There is export capitalisation issue. It should be
import { WebSocket } from 'nextjs-websocket'; Instead import { Websocket } from 'nextjs-websocket';
Otherwise you may face following issue.
image