Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dancherb opened this issue Mar 23, 2021 · 1 comment

Comments

@dancherb
Copy link

dancherb commented Mar 23, 2021

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!

@syedmahmad
Copy link

syedmahmad commented Jul 13, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants