Skip to content

Error: babel-preset-react-app forces to use only specific NODE_ENV or BABEL_ENV i.e 'development' / 'production' / 'test' #2592

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

Closed
rahulbansal89 opened this issue Jun 22, 2017 · 3 comments

Comments

@rahulbansal89
Copy link

rahulbansal89 commented Jun 22, 2017

Can you reproduce the problem with latest npm?

Yes

Can you still reproduce it?

Yes

Description

babel-preset-react-app forces to use only specific NODE_ENV or BABEL_ENV i.e development / production / test.

And when i am trying to use any another environment then it is showing the below error:

Module build failed: Error: Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV environment variables. Valid values are "development", "test", and "production". Instead, received: "staging"

But what to do if we need to use it with some another environment like for UAT environment etc. ?

Expected behavior

It should support any environment or environment other than specific should be treat like production.

@gaearon
Copy link
Contributor

gaearon commented Jun 22, 2017

This is intentional because this is how we decide which plugins to apply. However a cleaner way to do so would be by adding options to the preset, and reading target environment from options.

Would you like to send a PR for that?

@stale
Copy link

stale bot commented Dec 8, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Dec 8, 2018
@stale
Copy link

stale bot commented Dec 13, 2018

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

@stale stale bot closed this as completed Dec 13, 2018
@lock lock bot locked and limited conversation to collaborators Jan 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants