You have created your React App and using Yarn as package manager.
When you run command to kick off the App, yarn will look for the package.json file. In this file, it will look for the “start” field under scripts, and run whatever the command is defined there.-
It opens chrome browser and throws this error. The type of browser depends on what is set in launch.json
The error is something like:
There are different reasons for this error, most probably it is due to the user not having proper permissions or related to Cross Origin Resource Sharing (CORS) not set correctly (‘Access-Control-Allow-Origin’ not set). You can use Chrome Devtools (F12) to find more details and the exact error.
Another reason for the problem was browser caching the previous Microsoft account user details and trying to invoke the react App using that. Try to run the App using Chrome in Incognito mode.
This way it will prompt for user login where you can provide the correct user credentials.
Another way is to clear the Local Storage, Session Storage and Cookies details using DevTools as shown below and run the App again.