Repository navigation
Build the backend on Node 22 on Railway - #8
Merged
Merged
Conversation
Railway builds packages/backend on its own, so it never saw the Node 22 requirement in the root package.json and used Node 20. supabase-js needs Node 22's built-in WebSocket and crashed at startup without it. Pin Node 22 in the backend's package.json, a nixpacks.toml and .nvmrc.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Railway deploy crashed on every start with
Error: Node.js detected but native WebSocket not found, thrown whileTokenVerifiercreates the Supabase client.Why
packages/backendon its own, so it never sees theenginesfield in the rootpackage.jsonand builds with Node 20.WebSocket, and throws this error at startup when it's missing.Change
Pin Node 22 inside
packages/backendin three ways:engines.node: ">=22.11.0"inpackage.json, matching the root;nixpacks.tomlwithNIXPACKS_NODE_VERSION = "22";.nvmrc.Testing
WebSocket. Node 22 has one.After merging, confirm the Railway build log uses Node 22 and that
/healthreports ok.