简体   繁体   中英

After npm run build getting error that access is getting blocked by CORS policy

Hi i am newbie on react. Created an React app which is working fine on npm start but after npm run build i am not getting full page info. ie. i am getting nav bar but main content is not available, on console following error is present: 'file:///C:/Users/pkv97/OneDrive/Desktop/ReactJs/CodeWithHarry/TextUtilsHarry/text_utils/build/%E2%80%9Dmanifest.json%E2%80%9D' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted."

I tried run npm build on D drive as it is searching files on Onedrive but still facing same issue.

can someone guide how to fix it.

On npm build it should work same as it is working on npm start.

Re install NPM and Start then it'll work properly.

npm install --save && npm run build

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM