Local OK, Railway problems

In local all works, but in prod (railway) i have error with fetch
37 Replies
Percy
Percyā€¢2y ago
Project ID: 60cee507-70ce-477a-be3d-d91c81e600ac
jackson
jacksonā€¢2y ago
must be running an old node version
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
How i can change ?
Brody
Brodyā€¢2y ago
node 16 doesnt have fetch api enabled by default, v18 does set NIXPACKS_NODE_VERSION to 18
jackson
jacksonā€¢2y ago
set NIXPACKS_NODE_VERSION = 18
jackson
jacksonā€¢2y ago
Node | Nixpacks
App source + Nix packages + Docker = Image
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
in env variables ?
Brody
Brodyā€¢2y ago
in service variables
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
hmm šŸ˜­ i dont know where is it 2m i check
Brody
Brodyā€¢2y ago
click on your service, variables tab > new variable
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
šŸ˜
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
here?
Brody
Brodyā€¢2y ago
^
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
so here?
Brody
Brodyā€¢2y ago
yes NIXPACKS_NODE_VERSION = 18
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
Ah ok, I thought that variable service and environment variables was not the same thing i test it ! thats work
Brody
Brodyā€¢2y ago
awsome
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
but
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
šŸ˜¦
Brody
Brodyā€¢2y ago
not awsome
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
yeah oh its because i have an package-lock.json i think i delete it for test
Brody
Brodyā€¢2y ago
try running
npm i --package-lock-only
npm i --package-lock-only
in your project directory and try a redeploy, it looks to me like your lock file is out of sync with your package.json file
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
no okay
Brody
Brodyā€¢2y ago
lol no, you very much need that, it needs to be in sync with package.json, so try running the above command, then redeploy
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
that's work but
Brody
Brodyā€¢2y ago
no clue, you can try different versions of the swc wasm package, and if you want to provide me with a minimal reproducible example i could take a look at it too
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
okay i test different version and reply you if ok/not ok
Brody
Brodyā€¢2y ago
good luck šŸ™‚
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
bro i just commited a package.json with differents version and i see when i look deployement i have a deployemnt successfuly šŸ˜­
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
Brody
Brodyā€¢2y ago
so a different version of swc wasm works?
Gaetan šŸˆ
Gaetan šŸˆOPā€¢2y ago
I just committed different versions and it works too, even with the one I didn't care that it worked so, all good! thanks for your help !!
Brody
Brodyā€¢2y ago
no problem, glad you got it working! happy coding
Want results from more Discord servers?
Add your server