SACHERSKETCHBOOK

sachersketchbook.neocities.org

176,306 views
111 followers
1,320 updates
0 tips
can anyone who uses .json for their site explain how to get around the damn CORS policy: No 'Access-Control-Allow-Origin' error while running ur site locally? i am at my wits end
1 like
sachersketchbook's avatar sachersketchbook 1 week ago

'/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-file' in the terminal didn't seem to do it for me ๐Ÿ˜ญ

chiisana-wasurenagusa's avatar chiisana-wasurenagusa 1 week ago

allow-file-access-from-file fails if a Chrome was already open in the bg or if Chrome ignores/restricts the flag. Cleanest fix is to serve your folder over http://localhost using a tiny local web server instead of opening HTML files directly or using Chrome flags. Cmd + Q, then open Terminal, type cd and press return. running ls in terminal lists your index.html and .json files. Run python3 -m http.server 8000.

1 like
chiisana-wasurenagusa's avatar chiisana-wasurenagusa 1 week ago

Then just open your page after verification. It should look normal in chrome when you do it via localhost.

stupied's avatar stupied 1 week ago

If you're using vscode you could use this extension: https://marketplace.visualstudio.com/items?itemName=yandeu.five-server It basically does what the comment above says. It starts a local server with the folder you've selected. You just have to click a button instead of typing a command. Also it automatically refreshes the page every time you save changes.

1 like
sachersketchbook's avatar sachersketchbook 1 week ago

yessss thank u guys, i will try n see them both

Website Stats

Last updated 6 days ago
CreatedMay 19, 2023

Tags

art personal ocs