Running into build errors only on Railway
I am running into deployment failure that throws errors that I cannot reproduce locally. I have tried running Nixpacks locally and no errors were encountered either. What should I do?
66 Replies
Project ID:
e6e9a6da-436a-4fd9-8b55-56549881bc41
e6e9a6da-436a-4fd9-8b55-56549881bc41
what version of yarn are you using locally
I'm using 1.22.19
what version is railway using
I'm not sure hot to check. How should I check?
it would be in the build table at the top of the build logs
Is it this?
yarn 1x
can you run
yarn run build
locally without issues?lemme double check
yup it works
what version of node are you using locally?
v18.16.0
do you have the railway cli installed locally?
yes, i use railway up to deploy
your service has a github icon?
yup, it does
does that entail anything?
is date-fns a npm package?
i believe so, it's a dependency of another package
react-day-picker
was there any updates to railway? deployments were working perfectly last night and this morning i changed a minor detail to the code base and it stopped working
so i suspect the issue is on railway's sidethere where no updates to nixpacks, this would be a code / config issue
if you delete your local node_modules folder, reinstall the modules, and run another local build, does that succeed?
let me give it a try
specifically installing with the same frozen lock file flag railway uses
yup, it works
hmmm
you tried those steps with the frozen lock file?
yup, it works locally
is anybody also getting similar errors?
nope, this isnt a railway issue, I assure you
the weird thing is
I'm not saying it's not weird
i tried deploying to staging and it's working
delete your lock file, delete node_modules, regen your lock file, try the local build again
just tried it out, it works 🤔
what did you change lol
nono i meant, the local build works
I know
i deleted the lock file, deleted node modules, and did "yarn" "yarn build"
I'm asking what you changed that resulted in Railway failing to build
let me check
and can you provide the build logs for the last successful deploy
https://bookmarklets.up.railway.app/log-downloader/
one line hahaha
here are the logs
oh wait
this is the deploy logs
I have to ask, what's with all the
[0]
does it show up in railway like that?I think that's the "concurrently" package, i used to build the extension and the web simultaneously but then I realized i didn't need to build the extension on railway
so right now there's only 1 thing running concurrently
concurrently "yarn run build:web"that's why [0] gonna remove that now hahaha i still don't quite get why it works on the staging environment though
do you have your backend api serving the frontend by chance?
yup, the express app serves the react build
? is that no good?
would you be interested in me helping you setup your services properly? there's a good chance we fix what's wrong during that process
i'm interested, what should i do?
what does the structure of your repo currently look like, and if you can, could you share the repo?
the only difference for this is that staging deploys automatically on branch change, which right now is set to the main branch
you mean add you as a collaborator on the github repo?
if you'd be okay with that, yes, it would help me help you structure the repo correctly
would you need to run the project locally? since the project depends on some tokens to be set in the .env to run properly, i'm not sure if i can share them
i could share the codebase though, do you have an email account that i can share to?
nope, just need to get a lay of the land
brody192 is my gh username
just sent an invite, did you get it?
indeed
looking now
thanks for your help so far 🙏
so what you want is an isolated monorepo https://docs.railway.app/deploy/monorepo#isolated-monorepo
but you currently have both apps mushed together, can you work at separating the separate services out into a respective backend and frontend folder?
what if they do share code?
i know it's bad but they are sharing some types and utility functions <:pepe_sweat:786868788560920576>
then you want a shared monorepo
either way you shouldn't have the two services mushed together like you currently do
why would that cause a problem?
and its not very good practice to have the api serve the frontend
really?
i mean its just simply not the correct way to do it
hm, so how should it be separated?
really, you want two railway services one for your frontend and one for your backend, but you need to properly structure your repo before you worry about that
maybe you could use nx?
never heard of that, what does that do?
helps you manage a shared monorepo