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
  • Issues
  • #11942
Closed
Open
Issue created Jan 17, 2022 by Administrator@rootContributor

react-scripts@5 BROWSER in .env file is not working

Created by: stacy-rendall

Describe the bug

With react-scripts@5 BROWSER is not working when placed in an .env file (I'm using .env.local in this case)

i.e. BROWSER=msedge used to work with react-scripts@4, with v5 this is ignored and the default browser opens

Did you try recovering your dependencies?

Node version: 16.13.2 NPM version: 8.3.1

Which terms did you search for in User Guide?

Following guide here: https://create-react-app.dev/docs/advanced-configuration/

Environment

Environment Info:

current version of create-react-app: 5.0.0 running from C:\Users[username]\scoop\persist\nodejs-lts\cache_npx\c67e74de0542c87c\node_modules\create-react-app

System: OS: Windows 10 10.0.19044 CPU: (12) x64 Intel(R) Xeon(R) E-2176M CPU @ 2.70GHz Binaries: Node: 16.13.2 - ~\scoop\apps\nodejs-lts\current\node.EXE Yarn: Not Found npm: 8.3.1 - ~\scoop\apps\nodejs-lts\current\bin\npm.CMD Browsers: Chrome: 97.0.4692.71 Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.62) Internet Explorer: Not Found npmPackages: react: ^17.0.2 => 17.0.2 react-dom: ^17.0.2 => 17.0.2 react-scripts: 5.0.0 => 5.0.0 npmGlobalPackages: create-react-app: Not Found

Steps to reproduce

  1. set BROWSER in .env.local file
  2. npm start

Expected behavior

Specified browser opens

Actual behavior

System default browser opens, not as specified above

Assignee
Assign to
Time tracking