Home
Support Forums

CORS error on localhost

Hi thanks for reading.

I’m receiving a CORS error when fetching my Netlify functions from localhost:8888
(I installed Netlify CLI and ran netlify dev and then saw the CORS error in the web browser’s Network tab).

To fix this, should I add the header “Access-Control-Allow-Origin: http://localhost:8888” ? That doesn’t seem safe.

If not, how do we avoid CORS error when developing Netlify Functions locally?

My Netlify project is just vanilla JS and deploys from GitHub.

Thank you.

Hey there, @vcamp :wave:

I see you shared some new information in this thread. Does this mean you are no longer encountering this issue? Let us know :slight_smile:

yup that fixed it for me. Thanks!