-
Notifications
You must be signed in to change notification settings - Fork 127
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
[🐛 Bug]: Can't setup a websocket in an endpoint #894
Comments
Also the version that works locally, fails when deployed to cloudflare infrastructure with this error: { The version that doesn't work locally, generates the exact same error when deployed to cloudflare infrastructure. It would be nice if we can have a sample repository that works (both locally and when deployed) |
This seems to be where the error is being raised:
Just an observation: I can connect to the websocket if I remove Another observation: in a normal worker, if I try to recreate the response returned by This is the stack of the error in the runner: It seems like creating responses with I will create an issue in the workers repository too relevant: https://www.answeroverflow.com/m/1166443215029809162 |
next-on-pages environment related information
Description
I can't setup websocket with the
@cloudflare/next-on-pages
after version0.10.0
@dario-piotrowicz kindly provided this sample repository for running websocket inside next-on-pages projects:
https://github.com/dario-piotrowicz/next-app-websocket-pages.git
It was provided here
But it doesn't work with next-on-pages 0.10.0 or later locally and it doesn't work at all when deployed.
Reproduction
Clone this repository: https://github.com/dario-piotrowicz/next-app-websocket-pages.git
Change dependencies in package.json like this:
Run
npx @cloudflare/next-on-pages
Run
wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat
Try to connect to the websocket, for example with
websocat ws://localhost:8788/api/socket
Now try the same with
@cloudflare/next-on-pages==0.9.0
and it works.Try deploying both and none of them works when deployed with error:
Pages Deployment Method
None
Pages Deployment ID
https://b22ca0c8.next-app-websocket-pages.pages.dev
Additional Information
No response
Would you like to help?
The text was updated successfully, but these errors were encountered: