Reputation: 1291
With the version 1.0.5
of the create-react-app
boilerplate I've started receiving the fallowing warning:
*** process.env.ENV is not defined, assuming 'prod' env
I know how to create a custom environmental variables, but those require REACT_APP_
prefix.
Now, I've discovered that the message is being shown because of the Chrome's Grammarly
extension, and disabling it removes the message.
However, I'd like to know how I can resolve this regardless of the extensions.
I know that there are 2 more questions like this on the StackOverflow, but they include solutions that are using the Webpack. Unfortunately, I have no access to the Webpack, since I haven't ejected the create-react-app, and I don't plan to anytime soon.
Is there a way to declare the environment on process.env.ENV
in create-react-app
?
EDIT:
This was the main question. Is it technically possible to define it in the non-ejected create-react-app
?
Upvotes: 4
Views: 1355
Reputation: 16672
The Grammarly extension is the cause of this not React. Have logged a request with Grammarly Support and this is the result
Hailey (Grammarly Support) Jul 6, 11:33 PM PDT
Hi Lankymart,
Thank you for contacting Grammarly Customer Support!
Please rest assured that the technical team is aware of the problem and they are currently working on it.
Unfortunately, this will not be a quick fix and I cannot provide you with an estimated timeframe, as the developers will need some time to analyze the cause of this issue.
I’m going to close this case, but if you have further information regarding this issue, please reply to this email and the case will be re-opened for further investigation. We apologize for any inconvenience caused.
Best wishes, Hailey
Lankymart Jul 6, 12:49 PM PDT
The console window in Chrome is constantly showing the warning - "process.env.ENV is not defined" turning off the extensions removes the error, it is not related a specific website. Already on the internet threads are popping up with people reporting the same issue and the common thread is Grammarly. Has a bug been introduced into the extension perhaps?
Evidence:
https://github.com/facebookincubator/create-react-app/issues/2722#issuecomment-313017403 How to define process.env.ENV in create-react-app? https://stackoverflow.com/a/44940512/692942
Website URL: No specific URL issue is a extension bug.
Upvotes: 1