REACT_EDITOR=atom ERR

All we need is an easy explanation of the problem, so here it is.

My console keeps on saying that
“To set up the editor integration, add something like REACT_EDITOR=atom to the .env.local file in your project folder and restart the development server. Learn more”

I cant even find the .env file on my create-react-app.

Thank you in advance.

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

Create-React-App supports custom environment variables.

The documentation discusses how to declare these variables:

This can be done using two ways: either in your shell or in a .env file. Both of these ways are described in the next few sections.

Through the local environment

The first way is to add it to your local environment:

For instance, if you’re using bash, edit ~/.bashrc

Add export REACT_APP_EDITOR=atom to the bottom then restart your terminal (or source ~/.bashrc)

Through .env files in your application

The second way is to create a .env file at the root of your application directory, and add the variable on a single line there:

REACT_APP_EDITOR=atom

From the documentation, these types of files can be declared and will be consumed by Create-React-App:

.env: Default.
.env.local: Local overrides. This file is loaded
for all environments except test.
.env.development, .env.test, .env.production: Environment-specific
settings.
.env.development.local, .env.test.local, .env.production.local: Local
overrides of environment-specific settings.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply