cli
cli copied to clipboard
netlify open:site hangs with Brave browser
Describe the bug
netlify open:site
hangs or fails silently with Brave browser set as default.
The following command ran successfully and opened Firefox as expected:
BROWSER=firefox ntl open:site
To Reproduce
Steps to reproduce the behavior on Mac OS:
- Use latest CLI version
- Set Brave to default system browser
- Run
netlify open:site
- Notice that Brave browser has not opened after a considerable amount of time
I've noticed that sometimes the command completes after some minutes, but generally fails silently forever.
Configuration
No netlify.toml was used for this site.
System:
OS: macOS 12.2
CPU: (10) arm64 Apple M1 Pro
Memory: 1.51 GB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.3.0 - /opt/homebrew/bin/node
Yarn: 1.22.17 - /opt/homebrew/bin/yarn
npm: 8.3.0 - /opt/homebrew/bin/npm
npmGlobalPackages:
netlify-cli: 8.14.1
Expected behavior
Brave browser opens in a timely manner when running netlify site:open
.
CLI Output
Terminal hangs in this state:
The log line is here https://github.com/netlify/cli/blob/f1c4d1017acba380048c06efa98b51b967f763d2/src/commands/open/open-site.js#L27
which means it probably hangs on https://github.com/netlify/cli/blob/f1c4d1017acba380048c06efa98b51b967f763d2/src/utils/open-browser.js#L36.
And to add more context @whitep4nth3r, ntl dev
doesn't experience the same behavior, correct?
ntl dev
experiences the same behaviour. Whilst the development server has started and I can navigate to a working development site in a browser manually, ntl dev does NOT open a browser tab.
Interestingly, when I kill the ntl dev
process, that's when the browser tab opens.
@whitep4nth3r Are you still experiencing this issue?
I installed Brave & set it as my default browser. Then tried the open:site
command.
Version: netlify-cli/10.15.0
Brave Browser opens the the url as expected.
If you're still experiencing the issue:
Can you check which browsers are running on your system when you're using the open:site
command?
The external dependency (better-opn) which is currently being used to open the browser disregards the default browser preference on MacOS in some specific cases.
Not experiencing this issue anymore. Thanks for following up!