Skip to content
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

How to prevent REACT_EDITOR from opening when application crashes in development? #3706

Closed
k1sul1 opened this issue Jan 8, 2018 · 6 comments

Comments

@k1sul1
Copy link

k1sul1 commented Jan 8, 2018

Is this a bug report?

Not really.

Which terms did you search for in User Guide?

REACT_EDITOR, editor

I'm using Vim as my editor, which is highly relevant to the problem I'm having. When my application crashes and presents me with an error screen, and I happen to click on the code displayed, the terminal which is running npm run start tries to open the file in Vim.

image
image

I do not want this to ever happen, because the terminal that the watch process runs in is tiny, the Vim instance it launches isn't even running my Vim config, and when I exit the instance, the output of npm run start is often ruined (line breaks break, everything just goes full word wrap) until I restart the watcher. Lint errors and so on pretty much become unreadable.

While the feature probably is useful if you use an editor like VS Code, it grinds gears for users like me ;)

I tried setting REACT_EDITOR as false in .env, but it didn't work.

TL;DR: I want that npm run start only ever displays me build errors and warnings, and does not run any interactive programs.

@k1sul1
Copy link
Author

k1sul1 commented Jan 8, 2018

Setting REACT_EDITOR to none (as with BROWSER) seems to prevent the editor from opening.

It does print the following error message, which I'd also like to disable, if possible.

Could not open File.js in the editor.
The editor process exited with an error: spawn none ENOENT.

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: https://goo.gl/MMTaZt

@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

Happy to take a PR that disables the message specifically for the none setting.

@raerpo
Copy link
Contributor

raerpo commented Jan 9, 2018

i would like to give it a shot and solve this.

@gaearon
Copy link
Contributor

gaearon commented Jan 9, 2018

Sounds good

@gaearon
Copy link
Contributor

gaearon commented Jan 9, 2018

Fixed by #3721

@gaearon gaearon closed this as completed Jan 9, 2018
@gaearon
Copy link
Contributor

gaearon commented Jan 15, 2018

This is out in react-scripts@1.1.0! Please let us know if something doesn’t quite work.
https://github.com/facebookincubator/create-react-app/releases/tag/v1.1.0

@lock lock bot locked and limited conversation to collaborators Jan 20, 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