React blank page on build

I’ve been learning React (kind of new to it) and I’m working on a project and I did an npm create vite@latest. So far everything works fine when I do run dev. However when I do run build, then go to the dist folder and open the index.html file I get a blank page.

So I do an inspect page in FireFox and I get these errors –

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resources at file:///assets/index-J7cny882.js. (Reason: CORS request not http)

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resources at file:///assets/index-BAXwXR6k.css. (Reason: CORS request not http)

I’m bit puzzled by this. Don’t know whats wrong or how to fix it. I did come across some things online that mentioned adding “homepage”: “.” to package.json. I did that but didn’t help.

I appreciate the help.

Thanks.