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

fix(rsc): fix dev server websocket error #10192

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Mar 11, 2024

Fixes an error in dev when for RSCs. When the dev server starts up, there's a WebSocket server error: Port is already in use:

web | (node:93389) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
web | --import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("%40redwoodjs/vite/react-node-loader", pathToFileURL("./"));'
web | (Use `node --trace-warnings ...` to show where the warning was created)
web | Started server on http://localhost:8910
web | Error: The following dependencies are imported but could not be resolved:
web | 
web |   src/pages/FatalErrorPage (imported by /Users/dom/projects/redwood/redwood-app/web/src/App.tsx)
web |   src/Routes (imported by /Users/dom/projects/redwood/redwood-app/web/src/App.tsx)
web | 
web | Are they installed?
web |     at file:///Users/dom/projects/redwood/redwood-app/node_modules/vite/dist/node/chunks/dep-52909643.js:45779:23
web |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
web |     at async file:///Users/dom/projects/redwood/redwood-app/node_modules/vite/dist/node/chunks/dep-52909643.js:45187:38
web | WebSocket server error: Port is already in use

We have two Vite servers running in middleware mode. Seems like one of them needs its own server.

@jtoar jtoar added the release:fix This PR is a fix label Mar 11, 2024
@jtoar jtoar added this to the RSC milestone Mar 11, 2024
@jtoar jtoar added the changesets-ok Override the changesets check label Mar 11, 2024
@jtoar jtoar marked this pull request as ready for review March 11, 2024 09:20
@jtoar jtoar merged commit f2e875f into main Mar 11, 2024
43 of 50 checks passed
@jtoar jtoar deleted the ds-rsc/fix-dev-server-websocket-error branch March 11, 2024 09:39
@Josh-Walker-GM Josh-Walker-GM modified the milestones: RSC, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants