-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Railway deployment failed after updating to latest version of blitz #12
Comments
Try adding these lines: ARG DATABASE_URL
ENV DATABASE_URL ${DATABASE_URL} |
Hi @christianto88 thank you for reporting this Just to confirm,
|
@abuuzayr Yes it is on |
This error shows up for me whenever I upgrade to Prisma@^3 and run It shouldn't have to be present to build, and one could argue is a security risk to expose that variable to the bundler. That should only be a runtime variable/secret that even the Dockerfile shouldn't have to know about. When I run my app in production it gets injected as a K8s secret. For now I'm still on [email protected] until this gets resolved. |
@jcmcneal Is there an open issue for that in prisma repo? |
A workaround that worked on one of my projects is to provide a dummy DATABASE_URL to blitz. I used It seems to me that blitz might somehow always trigger Prisma to run during build without running any query? This doesn't happen when I'm using Next with Prisma. |
That's insightful information @chrsep, thank you! I will try using the dummy variable in my dockerfile and see how it goes. If Next doesn't have this issue with Prisma, but Blitz does, then you may be right about it triggering Prisma to connect to the db unintentionally. @beerose I didn't find any open issues in the Prisma repo about this. However, I think it's related to how Blitz works with Prisma@^3. |
Do you have static pages that make calls to DB? If yes, that could cause the issue with the missing DB URL during the build. Otherwise, I haven't yet found anything internally that could cause this issue. We changed the Prisma version in new app templates from 2.x to 3.x but that didn't require any changes in Blitz code. I suppose something changed with |
I have an app running on Railway with Blitz v0.44.3 and a Dockerfile very similar to this one. I remember using the trick I mentioned earlier because there has to be a Btw, that may need to be fixed. It also happened to me when trying to apply the same method |
What is the problem?
Deployment on Railway failed because cannot find environment variable DATABASE_URL.
I am deploying using Dockerfile and the error occurs when running blitz build
Found a workaround by adding ARG DATABASE_URL to my Dockerfile
Paste all your error logs here:
Paste all relevant code snippets here:
Dockerfile before upgrading blitz ( worked previously )
Package.json before upgrading blitz ( worked previously )
New package.json
What are detailed steps to reproduce this?
railway up
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response
The text was updated successfully, but these errors were encountered: