question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lingui extract doesn't set NODE_ENV required by babel-preset-react-app

See original GitHub issue

When I run ‘lingui extract’ I receve this message error:

Error: Using babel-preset-react-apprequires that you specifyNODE_ENVorBABEL_ENV environment variables. Valid values are "development", "test", and "production". Instead, received: undefined.

‘lingui extract’ work only with this setup: ‘NODE_ENV=production lingui extract’

Is it a bug? What’s the problem?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tricoder42commented, Aug 17, 2018

Create React App uses development env for everything except for build. Ideally we should handle this without a warning, because CRA handles it under the hood without user’s interference.

I’m trying to come up with scenario, when extracting messages in development env would be harmful (or in production)… It seems that for our usecase (extracting messages from source), there’s no difference. Setting env to production might be after all safer option.

Ideas welcome!

I want to close this with upcoming 3.0 release, which will have better support for CRA.

1reaction
tricoder42commented, Aug 25, 2018

Update: The env will be set to development after all.

I’m working on new version of plugins/macros and in production mode they will remove all unnecessary attributes, like description and defaults. These attributes are used only offline (either in message catalogs as a hint for translators or during compile), but they aren’t needed in production.

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel-preset-react-app not picking up environment variables
Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV environment variables. Valid values are "development", "test", ...
Read more >
How to setup your perfect Webpack dev server environment ...
The first step I need to make is to create an environment variable called NODE_ENV . This is required for the babel preset...
Read more >
WebPack production environment is NOT the NODE_ENV or ...
BABEL_ENV, when this is not available then it uses process.env.NODE_ENV if even that is not available then it defaults to "development". Alright ...
Read more >
react-app-rewired - npm Package Health Analysis - Snyk
Tweak the create-react-app webpack config(s) without using 'eject' and without creating a fork of the ... Get started free ... No known security...
Read more >
How can I set NODE ENV production on Windows - Edureka
NODE_ENV =production node myapp/app.js. However, this doesn't work on Windows. Is there a configuration file where I can set the attribute?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found