Prisma doesn't connect to DB in AWS Amplify
Unanswered
elpupper posted this in #help-forum
elpupperOP
I have the t3 turborepo setup i had some issues with env var in amplify not working in SSR but then i solved all of those issues. But now i have the problem of where prisma doesn't connect to the database when deployed. Not sure what to do.
If you need any more information please let me know.
The build locally works perfectly. Just the issue with prisma now im Amplify
If you need any more information please let me know.
The build locally works perfectly. Just the issue with prisma now im Amplify
44 Replies
elpupperOP
bump
@elpupper I have the t3 turborepo setup i had some issues with env var in amplify not working in SSR but then i solved all of those issues. But now i have the problem of where prisma doesn't connect to the database when deployed. Not sure what to do.
If you need any more information please let me know.
The build locally works perfectly. Just the issue with prisma now im Amplify
Masai Lion
maybe with a littel bit of code we can help you
@Masai Lion maybe with a littel bit of code we can help you
elpupperOP
ok so in the turborepo i have turbo.json setup to have globalEnvs
"globalEnv": [
"DATABASE_URL",
]then inside apps/nextjs in next.config.mjs i have the env config
env: {
DATABASE_URL: process.env.DATABASE_URL ?? "",
},and in amplify
Masai Lion
i do not use turborepo but for me it is that way maybe it helps you
in .env
elpupperOP
yes
Masai Lion
and thats it
normaly your connected
elpupperOP
...
i know man
thats locally
that works fine
everything works fine locally
its deployement
im trying to deploy my website
Masai Lion
ahhh ok i did it in a other one
elpupperOP
but it doesnt recognize the database_url env var for some reason
Masai Lion
2 sec
ok go to your package.json
@elpupper
which one 😂
Masai Lion
how many do you have haha
elpupperOP
ok
what about it
@Masai Lion how many do you have haha
elpupperOP
i lost count
maybe 5
Masai Lion
your gone change the build one like this
elpupperOP
i already have that setup in the turbo build
"build": {
"dependsOn": ["^build", "^db-generate"],
"outputs": [".next/**", ".expo/**"]
},Masai Lion
its so deferent hahah
elpupperOP
monorepo
Masai Lion
ok so i don't know
i did this and for me it works
sorry
elpupperOP
damn
day 2 of being stuck