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

[3,3.0] Unable to open browsers on WSL #8081

Closed
endiliey opened this issue Dec 5, 2019 · 22 comments · Fixed by #8364
Closed

[3,3.0] Unable to open browsers on WSL #8081

endiliey opened this issue Dec 5, 2019 · 22 comments · Fixed by #8364

Comments

@endiliey
Copy link
Contributor

endiliey commented Dec 5, 2019

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.
sindresorhus/open#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
@endiliey endiliey changed the title Unable to open browsers on Windows [3,3.0] Unable to open browsers on Windows Dec 5, 2019
@endiliey endiliey changed the title [3,3.0] Unable to open browsers on Windows [3,3.0] Unable to open browsers on WSL Dec 5, 2019
@whengely
Copy link

whengely commented Dec 5, 2019

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

@bogdan-calapod
Copy link

bogdan-calapod commented Dec 6, 2019

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

@hikurangi
Copy link

hikurangi commented Dec 12, 2019

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"

@andriijas
Copy link
Contributor

andriijas commented Dec 12, 2019

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?

@jly36963
Copy link

I'm also experiencing this issue

image

@ramiraza
Copy link

ramiraza commented Dec 22, 2019

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

@seonggwonyoon
Copy link

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

@nik27
Copy link

nik27 commented Dec 24, 2019

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

@InveterateCoder
Copy link

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.

@ramiraza
Copy link

ramiraza commented Jan 5, 2020

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 👍👍

@julianruizsa
Copy link

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

@kwahsog
Copy link

kwahsog commented Jan 8, 2020

Getting this too :(

@GuillermoDLCO
Copy link

I have same bug :c

@andriijas
Copy link
Contributor

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

@tomcanham
Copy link

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.

@rayjackson13
Copy link

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

@InveterateCoder
Copy link

InveterateCoder commented Jan 20, 2020

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

@Kyrluckechuck
Copy link

@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!

@vince1995
Copy link
Contributor

vince1995 commented Jan 21, 2020

Why not downgrade open back to 6.3.0?

@andriijas
Copy link
Contributor

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

@atlefren
Copy link

Workaround:

BROWSER=none npm start

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

@JustinData
Copy link

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

@lock lock bot locked and limited conversation to collaborators Feb 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.