CORS errors are the worst, right? For javascript load json file from desktop, you could also try Electron if you’re building a desktop app. It has full filesystem access, so no CORS issues.
Otherwise, the `fetch()` workaround is either:
1. Use a local server (best practice).
2. Use `XMLHttpRequest` with `file://` (not reliable).
Here’s a quick local server setup:
```bash
python -m http.server 8000
```
Then hit `http://localhost:8000/data.json` in your fetch call.
Otherwise, the `fetch()` workaround is either:
1. Use a local server (best practice).
2. Use `XMLHttpRequest` with `file://` (not reliable).
Here’s a quick local server setup:
```bash
python -m http.server 8000
```
Then hit `http://localhost:8000/data.json` in your fetch call.
