NPM build script started to fail
I am running migrations during the build and have the following script in my package.json for this:
"migrate:deploy": "DATABASE_URL="$MIGRATE_DATABASE_URL" prisma migrate deploy",
It seems like the script doesn't have access to the ENV variables anymore even though there were no changes.
32 Replies
Project ID:
a32aec5d-84a3-4341-ac97-84f750c61df3
a32aec5d-84a3-4341-ac97-84f750c61df3
what is
MIGRATE_DATABASE_URL
set to?the postgres connection url
public or private url?
postgres[ql]://[username[:password]@][host[:port],]/database
^
Ran a test via this script: "testenv": "echo export $MIGRATE_DATABASE_URL",
actually this: "testenv": "echo Migrate Database URL: $MIGRATE_DATABASE_URL && echo Database URL: $DATABASE_URL"
}
and don't seem to have access
^
Are you asking me to share my access credentials to the db?
not at all
Then I don't get your "public or private url"
are you using a public or private database url
sorry needed to check on that. I am using the public url
how are you getting railway to run your
migrate:deploy
scriptvia my package.json (which has worked fine so far until recently):
"build": "npm run testenv && npm run migrate:deploy",
"migrate:deploy": "DATABASE_URL="$MIGRATE_DATABASE_URL" prisma migrate deploy"
The container which is currently still up and running resolved to node 21.1.0
The failing container is resolving to 20.9.0
I wonder if it's somehow related to the project using Heroku-20 buildpack which based on the UI is now deprecated in railway
oh wow, didnt think id ever run into anyone who is still using heroku's buildpack
hahaha, haven't really touched this app for a long time π
try to get it running on nixpacks?
is there a migration guide?
unfortunately no
Is there anything where I can find a proper walkthrough how I would create a nodejs project that runs migrations during buid process?
dont know why you have the
DATABASE_URL="$MIGRATE_DATABASE_URL"
otherwise i dont see anything wrong with how youre doing itDo I just have to add a nixpacks.toml and then railway picks it up from there or do I have to also change some settings?
im going to chalk this up to using a build pack that was deprecated like over 3 years ago
i honestly dont know how to switch
but @jr would know
Hey @manubier, wow I am surprised to find this project using the buildpacks. They are very much depreceated and should not be used. I can switch your app over to nixpacks if you would like
That would be awesome!
The overall prject is actually split up into 3 railway projects and all are still using the old buildpack. Should I just post the ids also here?
yup please do
I've updated one already
4c5a05a8-8ff6-40cd-b506-3c5d7efa5654
2bd6ba91-fc04-479a-bcce-fbe0d3638596
Do I still have to do something for build scripts I used before or should this be working now?
You will just need to redeploy
nice, seems to work. Thank you!
glad I could help π