Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Access to fetch at 'file:///Users/questions.json' from origin 'null' has been blocked by CORS policy! #36

Open
AAdewunmi opened this issue Aug 10, 2023 · 1 comment

Comments

@AAdewunmi
Copy link

Hi,
I'm get this error message when I try to execute fetch.
Any ideas for a fix?
Thanks

Screenshot 2023-08-10 at 06 55 13
@adityak1911
Copy link

Its because a html page cannot access file using file:///Users, its done for users security so that websites don't access any other personal / system files

create a http server and run the application on it

Alternatively, you can install python 3

  1. cd into the main project directory
  2. python -m http.server or python3 -m http.server

you will get a message like
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
open that link and you are good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants