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

Allow failing the build when environment variables are missing #2963

Open
dnagir opened this issue Apr 28, 2019 · 1 comment
Open

Allow failing the build when environment variables are missing #2963

dnagir opened this issue Apr 28, 2019 · 1 comment

Comments

@dnagir
Copy link

dnagir commented Apr 28, 2019

🙋 feature request

Given the environment variables, I am using are missing in a .env* file
When I parcel build
Then the build should fail and suggest that the env var is missing

This would make it much safer to build the application as it would fail at the build-time rather than when it has already been deployed.

🤔 Expected Behavior

When the JS code refers to the env variables using process.env.FOO, it should fail when such a variable is not set.

😯 Current Behavior

When the JS code refers to the env variables using process.env.FOO, it gets replaced with void 0 (undefined) and succeeds the build.

💁 Possible Solution

  • always fail when the environment variable is missing
  • need to consider if backwards compatibility is important
  • potentially allow to opt-in/out of this behaviour

🔦 Context

I built and deployed the application without realising that the env vars were missing.

@tannerntannern
Copy link

I could really use this feature as well. Any plans to add this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants