CLI to build and develop Next.js apps for Cloudflare Pages
### next-on-pages environment related information ``` System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.1.0: Mon Sep 30 00:10:31 PDT 2024; root:xnu-11215.40.63~39/RELEASE_ARM64_T6000 CPU: (10) arm64 Apple M1 Pro Memory: 32 GB Shell: /bin/bash Package Manager Used: npm (10.8.2) Relevant Packages: @cloudflare/next-on-pages: 1.13.5 vercel: N/A next: 14.2.15 ``` ### Description I can't setup websocket with the `@cloudflare/next-on-pages` after version `0.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](https://github.com/cloudflare/next-on-pages/issues/131) 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 1. Clone this repository: https://github.com/dario-piotrowicz/next-app-websocket-pages.git 1. Change dependencies in package.json like this: ```json "dependencies": { "@types/node": "22.7.6", "@types/react": "18.3.11", "@types/react-dom": "18.3.1", "next": "14.0.0", "react": "18.3.1", "react-dom": "18.3.1", "typescript": "5.6.3" }, "devDependencies": { "@cloudflare/workers-types": "^4.20241011.0", "@cloudflare/next-on-pages": "==0.10.0", "vercel": "^28.0.0" } ``` 1. Run `npx @cloudflare/next-on-pages` 1. Run `wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat` 1. Try to connect to the websocket, for example with `websocat ws://localhost:8788/api/socket` 1. Now try the same with `@cloudflare/next-on-pages==0.9.0` and it works. 1. Try deploying both and none of them works when deployed with error: ``` { "stack": " at ke (bundledWorker-0.8185137090843237.mjs:702:50)", "name": "RangeError", "message": "Responses may only be constructed with status codes in the range 200 to 599, inclusive.", "timestamp": 1729141252885 } ``` ### Pages Deployment Method None ### Pages Deployment ID https://b22ca0c8.next-app-websocket-pages.pages.dev ### Additional Information _No response_ ### Would you like to help? - [x] Would you like to help fixing this bug?
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by sassanh and has received 3 comments.