R
Railway•12mo 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•12mo ago
Project ID: 8f1d8cfc-373d-4189-9320-7a799917bd63,95ed3ad8-09bd-4f34-8f2f-dc61bb1275cc,9066485d-e564-49bd-aa60-1328a349d472
Fragly
Fragly•12mo ago
That's super weird 🤔 does it work if you set the node version in your package.json ?
stars
starsOP•12mo ago
Nope, tried that too "engines": {"node": ">=18.0.0"} still only uses 16
stars
starsOP•12mo ago
No description
stars
starsOP•12mo ago
No description
Fragly
Fragly•12mo ago
Dang, well I'm out of ideas then perhaps someone else has an idea..
stars
starsOP•12mo 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•12mo ago
yea 😭
stars
starsOP•12mo ago
any insight into this? It's really hindering my team's progress
stars
starsOP•12mo ago
I'll upload shortly, currently afk.
stars
starsOP•12mo 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•12mo ago
You're building a node 16 environment 🤨
stars
starsOP•12mo 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•12mo ago
I think it's ignoring it because you specified your own dockerfile
Fragly
Fragly•12mo ago
and your own dockerfile states that it should build from node 16
stars
starsOP•12mo 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•12mo 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
starsOP•12mo ago
cool cool that's fine just was making sure what i was doing wasn't redundant
Brody
Brody•12mo 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
starsOP•12mo ago
Oh thanks! will take a look instead of using custom dockerfile But cool. Feel free to close this ticket :D
Fragly
Fragly•12mo ago
just right click and "mark as solution" to whatever message contains the solution you wanted
Want results from more Discord servers?
Add your server