Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !7375

Exit from startBrowserProcess when no browser is provided.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/atlefren/7251_WSL_enoent_no_browser into master Jul 15, 2019
  • Overview 11
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: atlefren

In cases where no browser is set, the open library fails with an ENOENT.

This means that on Windows 10 with Windows Subsystem for Linux, if the user has not added /mnt/c/Windows/System32 to their $PATH, this will fail, as the open library fails to find the cmd.exe process.

This could possibly by fixed by modifying the open library to handle this issue, however, my reasoning is that if no browser is provided to startBrowserProcess, the call to open should fail nevertheless (however, I see that some cases are handled by setting browser to undefined, so this should perhaps be checked on OSX.

The change is easy: if no browser is provided, we return early to avoid an (inevitable) crash.

This means that npm start on WSL without /mnt/c/Windows/System32 in the PATH should behave as an npm start with the env-variable BROWSER=none. This is the same behaviour as in react-scripts 2.x

This solves #7251

Tested on WSL running on Microsoft Windows [Version 10.0.18890.1000]

  • npm link in create-react-app/packages/react-dev-utils
  • npx create-react-app testapp
  • cd testapp
  • npm uninstall react-dev-utils
  • npm link dev-utils
  • npm start

Verified that "Compiled successfully!" shows up.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/atlefren/7251_WSL_enoent_no_browser