2023-07-05 15:11:16 +02:00
---
title: Env Loading Disabled
---
2020-05-11 22:32:33 +02:00
2023-07-05 15:11:16 +02:00
## Why This Error Occurred
2020-05-11 22:32:33 +02:00
In your project you have `dotenv` listed as a `dependency` or a `devDependency` which opts-out of Next.js' automatic loading to prevent creating a conflict with any existing `dotenv` behavior in your project.
This is also disabled if a `package.json` isn't able to found in your project somehow.
2023-07-05 15:11:16 +02:00
## Possible Ways to Fix It
2020-05-11 22:32:33 +02:00
2020-05-15 21:02:16 +02:00
Update to the latest version of Next.js (>= v9.4.1) where this support is enabled regardless of `dotenv` being installed.
Remove `dotenv` from your `devDependencies` or `dependencies` and allow Next.js to load your `dotenv` files for you.
2020-05-11 22:32:33 +02:00
2023-07-05 15:11:16 +02:00
## Useful Links
2020-05-11 22:32:33 +02:00
- [dotenv](https://npmjs.com/package/dotenv)
- [dotenv-expand](https://npmjs.com/package/dotenv-expand)
- [Environment Variables](https://en.wikipedia.org/wiki/Environment_variable)
2023-07-05 15:11:16 +02:00
- [Next.js Environment Variables Docs](/docs/pages/building-your-application/configuring/environment-variables)