Local development CORS errors when pointed to production

Hello,

We currently have 1 environment in prismic setup, that is called production. For Local development, we are pointing to our production environment of prismic. Unfortunately, during development we are getting all kinds of CORS issues, i assume because of the domain we are using for local development ( http://myapp.localhost). We happen to be using the "axios" to make the ajax call from the users browser as shown below

    axios.get(prismicApi).then((val) => {
      const { ref } = val.data.refs[0];
      axios
        .get(`${prismicApi}/documents/search`, {
          params: {
            ref,
            q: '[[at(document.type, "promos")]]',
          },
        })

What do we need to do in order to configure prismic to allow such a CORS request to be made so we can remove these annoying errors from our local development experience?

Hi @jtim08515

Thanks for reaching out.

Can you please provide more information about the technology you are using and your repository name (you can share that in a private message)?

Have you tried to use a regular local host without a reverse proxy? Do you get the same error?

Hey @fares,

localhost gives us the same error.

1 Like