Warning: consolidate your env vars

Hi developers, I am new to prisma and started enjoying it, the whole ecosystem is amazing, however since i am new, started facing some initial hiccups. I just have a single .env file in my root directory, but whenever i get any prisma issue, it also put a warning with a code snippet, seems like not everyone is facing this and hence couldn't find much details online. may be its my tech stack :shrug: (Hono + Bun + Prisma) Can someone please guide me how to get rid of this. here is the warning:
16 | `)}
17 |
18 | We suggest to move the contents of ${Y(l)} to ${Y(a)} to consolidate your env vars.
19 | `;throw new Error(u)}else if(t==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>W(c)).join(", ")} in ${Y(a)} and ${Y(l)}
20 | Env vars from ${Y(l)} overwrite the ones from ${Y(a)}
21 | `;console.warn(`${ke("warn(prisma)")} ${u}`)}}}}function _s(e){if(Ep(e)){Mi(`Environment variables loaded from ${e}`);let r=$i.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Os(r),message:Ie(`Environment variables loaded from ${wr.default.relative(process.cwd(),e)}`),path:e}}else Mi(`Environment variables not found at ${e}`);return null}function Ns(e,r){return e&&r&&wr.default.resolve(e)===wr.default.resolve(r)}function Ep(e){return!!(e&&an.default.existsSync(e))}function qi(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function xr(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function ji(e,r){if(e.length===0)return;let t=e[0];for(let n=1;n<e.length;n++)r(t,e[n])<0&&(t=e[n]);return t}function x(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}var Fs=new Set,st=(e,r,...t)=>{Fs.has(e)||(Fs.add(e),Oi(r,...t))};var T=class e extends Error{clientVersion;errorCode;retryable;constructor(r,t,n){super(r),this.name="PrismaClie | ... truncated
16 | `)}
17 |
18 | We suggest to move the contents of ${Y(l)} to ${Y(a)} to consolidate your env vars.
19 | `;throw new Error(u)}else if(t==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>W(c)).join(", ")} in ${Y(a)} and ${Y(l)}
20 | Env vars from ${Y(l)} overwrite the ones from ${Y(a)}
21 | `;console.warn(`${ke("warn(prisma)")} ${u}`)}}}}function _s(e){if(Ep(e)){Mi(`Environment variables loaded from ${e}`);let r=$i.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Os(r),message:Ie(`Environment variables loaded from ${wr.default.relative(process.cwd(),e)}`),path:e}}else Mi(`Environment variables not found at ${e}`);return null}function Ns(e,r){return e&&r&&wr.default.resolve(e)===wr.default.resolve(r)}function Ep(e){return!!(e&&an.default.existsSync(e))}function qi(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function xr(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function ji(e,r){if(e.length===0)return;let t=e[0];for(let n=1;n<e.length;n++)r(t,e[n])<0&&(t=e[n]);return t}function x(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}var Fs=new Set,st=(e,r,...t)=>{Fs.has(e)||(Fs.add(e),Oi(r,...t))};var T=class e extends Error{clientVersion;errorCode;retryable;constructor(r,t,n){super(r),this.name="PrismaClie | ... truncated
Thanks for your guidance in advance!
2 Replies
Prisma AI Help
Prisma AI Help2mo ago
You've gone full bot mode! Let me fetch that AI answer for you ASAP. It sounds like you're seeing a Prisma warning about consolidating your environment variables, even though you only have a single .env file in your project root. This warning typically appears when Prisma detects conflicting environment variables in multiple .env files (for example, one in your root and another in ./prisma), or if it thinks there are duplicate variables being loaded from different locations. What triggers this warning? Prisma CLI looks for .env files in several locations, in this order: 1. Project root (./.env) 2. The same folder as your Prisma schema (e.g., ./prisma/.env) 3. Other schema-specified locations If the same variable (like DATABASE_URL) is defined in more than one of these files, Prisma will warn you and suggest consolidating them into a single .env file in your project root. This is to avoid confusion and potential conflicts about which value is used Managing Prisma ORM environment variables and settings. How to resolve it: - Make sure you only have one .env file, ideally in your project root. - Remove any .env files from the prisma directory or elsewhere in your project. - If you use symlinks or tools that generate .env files in multiple places, ensure only one is present at runtime. If you still see the warning: - Double-check for hidden or symlinked .env files. - Some users in monorepos or with certain setups (like symlinks or automated tools) have reported similar issues. In those cases, Prisma may still detect multiple .env files even if you think there’s only one Provide a way to disable env conflicts warning. Suppressing the warning: You can set the environment variable PRISMA_DISABLE_WARNINGS=1 to suppress all Prisma CLI warnings, including this one Provide a way to disable conflict for env vars w arning. If you continue to have issues, please check for any .env files in subdirectories or symlinked locations, and ensure your tooling isn’t generating extra .env files at build or runtime. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Nurul
Nurul2mo ago
Can you set PRISMA_DISABLE_WARNINGS=1 as environment variable and see if you still get the same warning?

Did you find this page helpful?