Open Karthick-FK opened 2 years ago
I can confirm that BROWSER is also not working when placed in an .env
file with react-scripts@5 (I'm using .env.local
in this case), i.e. BROWSER=msedge
used to work with react-scripts@4, now the default browser opens
@stacy-rendall Am using "react-scripts": "3.4.1" in my package.json file
I can confirm that BROWSER is also not working when placed in an
.env
I noticed that too, but I thought I botched my recent system reinstall and was doing something wrong.
I believe the BROWSER_ARGS issue is somewhere around here /packages/react-dev-utils/openBrowser.js:#L77-L107, likely line 96 has to be changed to chromiumBrowser + " " + args
. Since I don't have a Mac, I cannot confirm the solution.
Hi @Karthick-FK, could you try to create a new project using the CRA version of the PR linked above? It should solve both the BROWSER
and BROWSER_ARGS
issue.
I tested the browser opening on Linux, testing on a Mac would be nice. Thanks!
I have tried the below method to start app in a web security disabled browser to avoid CORS issue. (Added in
.env
file)BROWSER=google chrome BROWSER_ARGS=--user-data-dir=/tmp/temporary-chrome-profile-dir --disable-web-security --disable-site-isolation-trials --ignore-certificate-errors --disable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure --unsafely-treat-insecure-origin-as-secure=http://localhost:3000
When we do this in terminal (open chrome command with above args) - It is launching the browser with given browser args. But, BROWSERARGS is getting ignored if we provide inside .env_ file. It is launching in the normal chrome browser (wit security enabled)
Please update me if you need further details from my end.