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

Netlify Dev: process.env missing variables from netlify.toml [dev] block #982

Closed
oles opened this issue Jul 13, 2020 · 3 comments
Closed
Labels
area: command: dev area: functions status: unconfirmed type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@oles
Copy link

oles commented Jul 13, 2020

- Do you want to request a feature or report a bug?
Seems like this is a bug. If it is not, this is a feature I'd like.
It also seems like many other people are looking for this, based on my random searches to find a solution.

- What is the current behavior?
Currently, if your netlify.toml file contains

...

[dev]
    environment = { NODE_ENV = "development" }

...

all the variables specified has seemingly no effect - not only the NODE_ENV key.

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?
For the console to log NODE_ENV: development

- Local Environment Information

────────────────────┐
 Environment Info   │
────────────────────┘

  System:
    OS: Linux 5.7 Arch Linux
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  Binaries:
    Node: 10.20.1 - /usr/bin/node
    npm: 6.14.6 - /usr/bin/npm
  Browsers:
    Firefox: 78.0.2
  npmGlobalPackages:
    netlify-cli: 2.58.0

netlify-cli/2.58.0 linux-x64 node-v10.20.1
@jonathan-mothership
Copy link

I have this issue as well, the [build.environment] section in the netlify.toml file is completely ignored using netlify dev which, at least for us, obliterates the value of using the Netlify CLI. We're forced to have another copy of the vars in a .env file due to the number of env vars we use which just causes pains when forgetting to change both.

[build.environment]
  NARF="zonk"
yarn netlify dev:exec env | grep zonk
yarn netlify dev -c env | grep zonk

Neither command seems to pull from the netlify.toml file.

Is this expected behavior? What's the value of netlify dev if it doesn't use the [build.environment]?

@erezrokah
Copy link
Contributor

Thanks for adding this information @jonathan-mothership, we are working on aligning this logic between the CLI and Netlify build system. See netlify/build#2040

@eduardoboucas
Copy link
Member

eduardoboucas commented Jan 15, 2021

Hi @oles and @jonathan-mothership! This should be fixed via #1722 and available in the latest version of the CLI.

If something isn't working as expected, feel free to reopen the issue. Thanks!

@erezrokah erezrokah added type: feature code contributing to the implementation of a feature and/or user facing functionality and removed type: bug code to address defects in shipped code labels Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: command: dev area: functions status: unconfirmed type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

4 participants