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

Using NODE_ENV instead of --env produces incorrect warning #912

Closed
ricardograca opened this issue Aug 16, 2018 · 3 comments · Fixed by #913
Closed

Using NODE_ENV instead of --env produces incorrect warning #912

ricardograca opened this issue Aug 16, 2018 · 3 comments · Fixed by #913

Comments

@ricardograca
Copy link

I'm submitting a bug report

  • Library Version:
    0.34.0

Please tell us about your environment:

  • Operating System:
    Ubuntu 16.04.5

  • Node Version:
    8.9.3

  • NPM Version:
    6.1.0
  • Browser:
    all

  • Language:
    all

  • Loader/bundler:
    all

Current behavior:

When running NODE_ENV=prod au run I'm greeted with this contradictory message:

The selected Node Environment (prod) is not a preconfigured option ('dev', 'stage', and 'prod')

Which is obviously wrong since it is one of the preconfigured options.

  • What is the expected behavior?

The message isn't displayed.

  • What is the motivation / use case for changing the behavior?

Not getting confused about whether the environment name is actually correct or not.

Related PR:

#491

Proposed solution

Taken straight from @n2liquid's comment in the linked PR:

let validOptions = ['dev', 'stage', 'prod'];
if (!validOptions.includes(NODE_ENV)) {
  console.log(`The selected Node Environment (${NODE_ENV}) is not a preconfigured option (${validOptions.join(', ')})`);
}
@avrahamcool
Copy link
Contributor

you should run au run --env prod

@ricardograca
Copy link
Author

That doesn't change the fact that the message is incorrect and using NODE_ENV is still a supported way of specifying the environment, so it should work properly.

@avrahamcool
Copy link
Contributor

didn't know about that. sorry 👍

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

Successfully merging a pull request may close this issue.

2 participants