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

12.0.0 react-dev-utils/openBrowser.js/startBrowserProces bug => BROWSER env value ignored #11844

Open
craigphicks opened this issue Dec 26, 2021 · 1 comment

Comments

@craigphicks
Copy link

Describe the bug

react-dev-utils@12.0.0 function startBrowserProcess is calling npm package open function open with wrongly shaped parameter.

Detected on LinuxOS.

Call from react-dev-utils/openBrowser.js/startBrowserProcess to open/open(url,options) is using wrong form for the options parameter. As a result, when using environment variable BROWSER, that value gets ignored and the default browser is opened instead.

react-dev-utils/openBrowser.js/startBrowserProcess

    var options = { app: browser, wait: false, url: true };
    open(url, options).catch(() => {}); // Prevent `unhandledRejection` error.
    return true;

The value of browser is the BROWSER env value, but the property app should be an object

{name: browser}

instead. Here are the usage examples provided by the open npm package page:

// Opens the URL in a specified browser.
await open('https://sindresorhus.com', {app: {name: 'firefox'}});

// Specify app arguments.
await open('https://sindresorhus.com', {app: {name: 'google chrome', arguments: ['--incognito']}});
@DamienCassou
Copy link

This is still an issue.

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

No branches or pull requests

2 participants