fresh install - prisma db:push fails when using .env.development & .env.production
Previous T3 apps I've created an .env.development and .env.production file and prisma has worked fine.
Setup a fresh install of T3 today and while db:push works if I have the environment file named simply as .env, as soon as I change to having .env.development and .env.production, it reports the following error: I've not edited env.js other than to add some additional environmental variables. Any suggestions?
Setup a fresh install of T3 today and while db:push works if I have the environment file named simply as .env, as soon as I change to having .env.development and .env.production, it reports the following error: I've not edited env.js other than to add some additional environmental variables. Any suggestions?
Solution:Jump to solution
Prisma recommends using https://www.npmjs.com/package/dotenv-cli https://www.prisma.io/docs/orm/more/development-environment/environment-variables/using-multiple-env-files
npm
dotenv-cli
A global executable to run applications with the ENV variables loaded by dotenv. Latest version: 7.4.1, last published: 2 months ago. Start using dotenv-cli in your project by running
npm i dotenv-cli
. There are 232 other projects in the npm registry using dotenv-cli.2 Replies
Solution
Prisma recommends using https://www.npmjs.com/package/dotenv-cli https://www.prisma.io/docs/orm/more/development-environment/environment-variables/using-multiple-env-files
npm
dotenv-cli
A global executable to run applications with the ENV variables loaded by dotenv. Latest version: 7.4.1, last published: 2 months ago. Start using dotenv-cli in your project by running
npm i dotenv-cli
. There are 232 other projects in the npm registry using dotenv-cli.Thank you, I've edited the "db:push" script and that has worked.