Prisma Optimize Initialization Missing Database URL
After waiting 2 hours for migrations, I decided to give Optimize a go. I have my database url in my .env.development file, which works great when initializing my prisma clients in other files, the DB services. However, it can't find it on my index file.
Here is the error that gets printed:
However, if I remove the prisma code from this file and log the process.env.DATABASE_URL, it prints out no problem.
The script I am running when the error occurs is this:
5 Replies
You decided to hold for human wisdom. We'll chime in soon! Meanwhile,
#ask-ai
is there if you need a quick second opinion.Hey 👋
If I understand correctly, you get this error only when you are using optimize extension, right?
If you remove withOptimize extension, everything works as expected?
Also, which prisma and optimize version are you using?
I just had the same issue and I thought looking in the discord might help and here we are! I also get the error
Environment variable not found: DATABASE_URL
but only when using the withOptimize
-extension on the PrismaClient
Using:
@christianalares or @Nurul Any update on this? I am experiencing the same thing
Hello! Here is how I fixed it.
Now I just need to figure out why migrations are taking 2 hours