Closed valexandersaulys closed 4 years ago
I fixed this rather bizarre error. It's not very knox specific but I'll close this out and let anybody else who trips across what to do.
The fix (for me):
Use Create-React-App's Proxying from package.json
to proxy out to http://localhost:800
and use relative URLs for all fetch requests (e.g. /api/
as opposed to localhost:8000/api/
). I gleaned this from this guide.
Firefox appears to play very strict with CORS issues and this only comes up in local development.
I've been at this and I'm still struggling.
Browser: Firefox 82.0 OS: Ubuntu 18.04
I've been trying to make requests using
fetch
which is built into javascript. I'm usingcreate-react-app
which is hosted on a separate URL from my Django backend. I have made sure to correct for CORS issues while I'm developing.But when I make the above request, I get this reply:
And on Firefox:
I did confirm that django requests do work so its not an issue of the request.
What in the world am I doing wrong?
Thanks, Vincent