Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.env values are not available in the next.config.js in dev mode starting from 10.0.8 #22985

Closed
iAdramelk opened this issue Mar 11, 2021 · 3 comments
Labels
bug Issue was opened via the bug report template.

Comments

@iAdramelk
Copy link

What version of Next.js are you using?

10.0.8

What version of Node.js are you using?

15.8.0

What browser are you using?

CLI

What operating system are you using?

macOS

How are you deploying your application?

local

Describe the Bug

After updating from 10.0.7 to 10.0.8 next.config.js and files imported from it stopped seeing ENV variables defined in .env files. In production mode it still works correctly.

After downgrading to 10.0.7 it works again.

Expected Behavior

Ir reads .env files content.

To Reproduce

  1. Add VARIABLE_NAME=123 to .env file.
  2. Add console.log(process.env.VARIABLE_NAME) to next.config.js.
  3. Run yarn next dev in CLI.
  4. Check CLI output for a line with 123.

On 10.0.8 it return undefined, on 10.0.7 it returns 123.

@iAdramelk iAdramelk added the bug Issue was opened via the bug report template. label Mar 11, 2021
@underfisk
Copy link

I do have the same result, my config is not even passing the image/domains so i assume something is not being correctly loaded from next.config.js

@ijjk
Copy link
Member

ijjk commented Mar 11, 2021

Closing as a duplicate of #22811

@ijjk ijjk closed this as completed Mar 11, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

4 participants