You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot run any Prisma commands or generate the client if the DATABASE_URL environment variable is not set #28869
changed the title [-]Cannot run any Prisma command if the database env variable is not set (should only require during migration/runtime)[/-][+]Cannot run any Prisma commands or generate the client if the `DATABASE_URL` environment variable is not set[/+]on Dec 5, 2025
+1 on this. We're running a turborepo monorepo with 4 prisma databases and in CI we just want to build clients. We don't even have the concept of a live database to connect to at that time. I suppose we could put in a dummy value but that seems like it should be unnecessary like OP said.
Hi, I confirm this is a duplicate of #28590.
I answered here, and alerted the colleagues in charge of the docs internally.
The TL/DR is: if your environment variable isn't guaranteed to exist, you should not use the env() utility from prisma/config. Use process.env['DATASOURCE_URL'] instead.
Reacted by Ariel Weinberger, Anthony Gregis and Nikolai Kolodziej
Why is the env variable needed at all during client generation? This seems like a bug.
Reacted by Anapeksha Mukherjee, Anthony Gregis, Marcos Stival, Daniel Bengtsson, Daniel Haupt, Nikolai Kolodziej, Ion Sobol, Oleksandr, Jay Bell, Roman and 2 more
Activity
[-]Cannot run any Prisma command if the database env variable is not set (should only require during migration/runtime)[/-][+]Cannot run any Prisma commands or generate the client if the `DATABASE_URL` environment variable is not set[/+]rhinodavid commentedon Dec 5, 2025
+1 on this. We're running a turborepo monorepo with 4 prisma databases and in CI we just want to build clients. We don't even have the concept of a live database to connect to at that time. I suppose we could put in a dummy value but that seems like it should be unnecessary like OP said.
rhinodavid commentedon Dec 5, 2025
Seems like a dupe of #28590
jkomyno commentedon Dec 8, 2025
Hi, I confirm this is a duplicate of #28590.
I answered here, and alerted the colleagues in charge of the docs internally.
The TL/DR is: if your environment variable isn't guaranteed to exist, you should not use the env() utility from prisma/config. Use
process.env['DATASOURCE_URL']instead.arielweinberger commentedon Dec 8, 2025
Why is the env variable needed at all during client generation? This seems like a bug.