Build error
I'm using yarn run build locally and it builds fine however, when it builds on Railway it ends up crashing - any leads would be appreciated.
Solution:Jump to solution
and you have a dockerfile, so please read this - https://docs.railway.app/guides/dockerfiles#using-variables-at-build-time
26 Replies
Project ID:
61f799c0-ab10-4e5f-af35-d5e92d8c7ff7
61f799c0-ab10-4e5f-af35-d5e92d8c7ff7
could u provide full build logs?
is it a nextjs frontend?
Sure and yeah it is
Part 1
Part 2
https://bookmarklets.up.railway.app/log-downloader/
use this please
are all your env variables set correctly?
Yep, they're identical to localhost except for APP_URL & MONGO_URL
could u check this? it seems to be in the same route the final error occurs
UploadThingError: Missing or invalid API key. API keys must start with
sk_.
Checking
Okay so I have the correct env set up for it and it still fails but, when I remove the section that involves it - it builds fine on Railway.
Is it related to upload thing?
weird :thonk:
Yeah
Any ideas? I've tried:
I have no idea on how to help you with this, does uploadthing have any sort of community? Maybe you can ask there
Okay sure, will try asking on there
I would also suggest trying to deploy on Vercel to see if the issue persists there
Testing
Works fine on Vercel
super weird issue, I really don't know what it could be
catch me up, whats the actually error message
Here are the error logs
this seems like the root error?
Yep
Pretty sure it is
Solution
and you have a dockerfile, so please read this - https://docs.railway.app/guides/dockerfiles#using-variables-at-build-time
Ok so I added:
ARG UPLOADTHING_SECRET
ARG UPLOADTHING_APP_ID
to the Dockerfile
and then added RAILWAY_DOCKERFILE_PATH="Dockerfile" to the variables on the Railway container
and it now works :D
Thanks again @Brody!
RAILWAY_DOCKERFILE_PATH="Dockerfile"
is redundant since thats what railway is going to use by default, but glad i could help!Ah okay good to know