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

Update opn for WSL/Bash on Windows support #1581

Closed
3 of 11 tasks
strarsis opened this issue Jul 6, 2018 · 9 comments · Fixed by #1582
Closed
3 of 11 tasks

Update opn for WSL/Bash on Windows support #1581

strarsis opened this issue Jul 6, 2018 · 9 comments · Fixed by #1582

Comments

@strarsis
Copy link
Contributor

strarsis commented Jul 6, 2018

Issue details

opn is required with 4.0.2 by browser-sync (used for opening the browser automatically).
However, this version doesn't work in WSL/Bash on Windows. The latest version works correctly in WSL/Bash on Windows. It would be nice if browser-sync could update opn to its recent release version 5.3.0.

Steps to reproduce/test case

Start browser-sync. Notice this warning:

[Browsersync] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [2.23.6]
  • Node [v8.11.3]
  • Npm [5.6.0]

Affected platforms

  • linux
  • windows
  • other: (Windows) WSL/Bash on Windows
  • OS X
  • freebsd
  • solaris

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • CLI
  • webpack

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

(not related to this general issue with outdated opn)

@strarsis
Copy link
Contributor Author

strarsis commented Jul 6, 2018

PR available: #1582

@raymacz
Copy link

raymacz commented Jul 8, 2018

I guess, similar issue with my git bash --version 2.18.0.windows.1 Issue

@Kurzdor
Copy link

Kurzdor commented Jul 14, 2018

You can use special BS version with updated opn package
Here is the GitHub repo: https://github.com/Kurzdor/browser-sync
And here is the npm package page: https://www.npmjs.com/package/browser-sync-wsl
Tested it on my machine, works greatly.
I will delete this BS version when devs will fix this issue.
Thanks a lot!

@caseywatts
Copy link

Thanks for doing this issue & PR @strarsis !!

This is so minor but so huge 👏

@strarsis
Copy link
Contributor Author

strarsis commented Aug 26, 2018

@shakyShane: Awesome! Could a new release be
published to npm so I can update browser-sync in the projects?

@shakyShane
Copy link
Contributor

yeah I'll get a release out in the next few hours

@ghost
Copy link

ghost commented Dec 29, 2019

Hi, where do I set the browser path? Same issue with browsersync 2.26.7

EDIT: not browsersyncs issue. the WSL distro I was using didn't have /mnt/c in the path, so it wouldn't open a browser. added the path and works fine.

@sidequestboy
Copy link

@LewisAndrewCampbell I'm running into the same on WSL - what does "added the path" mean? Where do you add /mnt/c to? My chrome executable is at /mnt/c/Program Files/Google/Chrome/Application/chrome.exe

@sidequestboy
Copy link

Ah, I added that full path /mnt/c/Program Files/Google/Chrome/Application/chrome.exe to the browser option in my bs-config.js that was generated using browser-sync init, which I am using via the --config bs-config.js option, and it was able to open my Windows chrome browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants