R
Railway•7mo ago
stars

Nixpacks is not using the correct node version

https://railway.app/project/8f1d8cfc-373d-4189-9320-7a799917bd63/service/95ed3ad8-09bd-4f34-8f2f-dc61bb1275cc?id=9066485d-e564-49bd-aa60-1328a349d472 Simply put, my env is using NIXPACKS_NODE_VERSION=18 and NIXPACKS_NO_CACHE=1 yet I get an incompatible node version error saying I'm running node 16? Not sure what else I can do considering this was working literally yesterday
Railway
404 - Page not found
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
Solution:
I think it's ignoring it because you specified your own dockerfile
Jump to solution
23 Replies
Percy
Percy•7mo ago
Project ID: 8f1d8cfc-373d-4189-9320-7a799917bd63,95ed3ad8-09bd-4f34-8f2f-dc61bb1275cc,9066485d-e564-49bd-aa60-1328a349d472
Fragly
Fragly•7mo ago
That's super weird 🤔 does it work if you set the node version in your package.json ?
stars
stars•7mo ago
Nope, tried that too "engines": {"node": ">=18.0.0"} still only uses 16
stars
stars•7mo ago
No description
stars
stars•7mo ago
No description
Fragly
Fragly•7mo ago
Dang, well I'm out of ideas then perhaps someone else has an idea..
stars
stars•7mo ago
Hopefully. Especially weird considering nixpacks says 18 is the default version anyway so not even sure why I had to try any of this in the first place haha
Fragly
Fragly•7mo ago
yea 😭
stars
stars•7mo ago
any insight into this? It's really hindering my team's progress
stars
stars•7mo ago
I'll upload shortly, currently afk.
stars
stars•7mo ago
This also occurs on different environments that don't have the extra config too but the error doesnt make sense as default node is 18, engines.node is 18, and NIXPACKS_NODE_VERSION is 18
Fragly
Fragly•7mo ago
You're building a node 16 environment 🤨
stars
stars•7mo ago
yeah, that's the issue im telling it to use node 18 on NIXPACKS_NODE_VERSION and engines.node yet it is entirely ignoring it and nixpacks should use v18 by default, so not sure why this is using 16 :(
Solution
Fragly
Fragly•7mo ago
I think it's ignoring it because you specified your own dockerfile
Fragly
Fragly•7mo ago
and your own dockerfile states that it should build from node 16
stars
stars•7mo ago
oh my god yeah you're right i feel so stupid because before railway didnt seem to have support for react apps using react router not sure if it does now? it would 404 on redirect so now i have a custom dockerfile that runs an nginx server redirecting all to /index.html
Brody
Brody•7mo ago
not sure if it does now?
nope, this is by design, railway was not designed as a frontend host, it is up to the user to provide railway with a build that will properly run the frontend (like you do with the dockerfile)
stars
stars•7mo ago
cool cool that's fine just was making sure what i was doing wasn't redundant
Brody
Brody•7mo ago
you can always get nixpacks to produce an image that serves spa csr apps https://github.com/brody192/create-react-app-starter/blob/main/nixpacks.toml
stars
stars•7mo ago
Oh thanks! will take a look instead of using custom dockerfile But cool. Feel free to close this ticket :D
Fragly
Fragly•7mo ago
just right click and "mark as solution" to whatever message contains the solution you wanted