Skip to content

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

Closed

Description

@rahulbansal89

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.

Activity

  1. gaearon commented on Jun 22, 2017

    @gaearon
    Contributor

    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?

  2. stale commented on Dec 8, 2018

    @stale

    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.

  3. stale commented on Dec 13, 2018

    @stale

    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.

  4. locked and limited conversation to collaborators on Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions