question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Having the package dotenv installed breaks 9.4.0 .env features

See original GitHub issue

Describe the bug

When the dotenv package is installed the new .env features of 9.4.0 don’t work: all variables are undefined.

To Reproduce

https://github.com/GriffinSauce/next-dotenv-bug

^ Remove dotenv and it will work as expected

System information

  • OS: Windows
  • Version of Next.js: 9.4.0
  • Version of Node.js: 12.16.3

Sidenote: regardless of the bug this release kicks ass, great work!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
Timercommented, May 11, 2020

Great idea! We’ll add a warning that we’re autodisabling it with a link to learn more.

2reactions
GriffinSaucecommented, May 11, 2020

Ah that’s pretty cool, it would be helpful to document that because right now that’s invisible behaviour.

Perhaps even log something like Detected dotenv package - autoloading .env is disabled ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dotenv - npm
Loads environment variables from .env file. Latest version: 16.0.3, last published: 3 months ago. Start using dotenv in your project by ...
Read more >
How to use different .env files with nextjs? - Stack Overflow
I saw the example with dotenv. But I don't like to define the variables in the .env file and also define them in...
Read more >
purescript-dotenv - Pursuit
Usage. First, place a .env file in the root of your project directory. See the Configuration Format section for more information.
Read more >
Serverless Dotenv Plugin
Preload function environment variables into Serverless. Use this plugin if you have variables stored in a .env file that you want loaded into...
Read more >
dotenv - npm Package Health Analysis - Snyk
Based on project statistics from the GitHub repository for the npm package dotenv, we found that it has been starred 16,426 times, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found