Create-react-app: [3,3.0] Unable to open browsers on WSL

Created on 5 Dec 2019  路  22Comments  路  Source: facebook/create-react-app

Describe the bug

Open v7 has a bug on Windows and WSL. Given that many CRA user could be on Windows + WSL, I guess this is going to hit a lot of people soon.
https://github.com/sindresorhus/open/issues/154

Related PR #7910 cc @andriijas as the one who sent PR to upgrade open from v6 to v7.

Did you try recovering your dependencies?

yes

Environment

OS: Linux 4.4
Node: 12.2.0
Yarn: 1.12.3
npm: 6.9.0
Watchman: 4.9.0
Xcode: N/A

I'm on WSL 1 though

Steps to reproduce

Only in windows/ WSL ecosystem

  1. Upgrade any CRA project to 3.3.0
  2. Run development server

Expected behavior

No error

Actual behavior

image

Reproducible demo

  1. git clone https://github.com/endiliey/rengorum.git
  2. cd frontend && yarn && yarn start
bug report needs triage

Most helpful comment

It is a bug with "react-scripts': "3.3.0".
Switch to 3.2.0 by editing package.json file then running npm install.
Worked for me.

All 22 comments

I also am getting this with WSL.
Linux: 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
Node: v12.13.1
Npm: 6.13.2

Also experiencing this on WSL2.

Windows 10 version 2004 build 19033.1 (Insider Slow Ring)
Linux 4.19.84-microsoft-standard
Node v12.7.0

Same here:

WSL2 on
Windows 10 Pro 10.0.19037 Build 19037
Node v13.3.0
Linux 4.19.84-microsoft-standard

    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-scripts": "3.3.0"

I can make a PR when they fix it in open. Try to pin open to 6.4.0 in your project package.json and see if that helps for now?

I'm also experiencing this issue

image

I'm having the same issue.

I am assuming everyone having this issue has to do with Windows SubSystems or installing Bash terminal on Windows 10 and then trying to run react. I personally have not tried running any other server. There is an open issue related to one of react's dependencies for opening URL in the browser. #154

I'm also experiencing this issue.
Windows 10 Pro 1909 Build 18363.535
Linux version 4.4.0-18362-Microsoft
Node v13.3.0

I'm having the same issue on WSL1 but i found a workaround.

When the error pops up press ok and then follow the link from terminal with Ctrl+Click. Default browser will open the app but on random port.

Windows 10 Pro 1903 Build 18362.535
Linux 4.4.0-18362-Microsoft GNU/Linux
Node 12.13.1

cra-issue1
cra-issue

It is a bug with "react-scripts': "3.3.0".
Switch to 3.2.0 by editing package.json file then running npm install.
Worked for me.

It is a bug with "react-scripts': "3.3.0".
Switch to 3.2.0 by editing package.json file then running npm install.
Worked for me.

You're a savior man. Thank you. I was struggling with this issue for last few weeks and had no idea the solution was this simple. It worked 馃憤馃憤

Same here. Just use npx create-react-app and the message windows "cannot find 'http://localhost:300' create react app wsl" just pop's up

Getting this too :(

I have same bug :c

I dont have access to a windows machine for a while. Anyone who can open a PR to open?

For those like myself who have ejected, you can modify your package.json to downgrade the react-dev-utils package to v9.1.0.

Change "react-dev-utils": "^10.0.0", to "react-dev-utils": "^9.1.0", and do npm install (or yarn).

Worked for me.

This is a bug with the latest update of _react-scripts_

Workaround:
Go to package.json
Change "react-scripts": "3.3.0" to "react-scripts": "3.2.0".
Then run yarn or npm i

That really worked for me. WSL1 tho, don't know about WSL2, but probably the same will help

It is a bug with "react-scripts': "3.3.0".
Switch to 3.2.0 by editing package.json file then running npm install.
Worked for me.

Okay, guys. I found the bug itself. To leave react-scripts: 3.3.0, just go to node_modules -> open -> index.js and delete the target redefinition under the win32 || isWsl section of the code like this.
Annotation 2020-01-20 142320

@InveterateCoder do you know of if there would be an implications that this undoes or breaks?

If you're pretty positive about it as a solution though, please create a PR!

Why not downgrade open back to 6.3.0?

@vince1995 its ok to make a PR, tag this issue and me.

Workaround:

BROWSER=none npm start

(This will disable trying to open a browser altogether though)

I was running fine on "react-scripts': "3.3.0" in WSL, until I installed react-app-polyfill. I now get the error above.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments

wereHamster picture wereHamster  路  3Comments

Evan-GK picture Evan-GK  路  3Comments

ap13p picture ap13p  路  3Comments