How to deal with strict-origin-when-cross-origin error in Vue3 app?

1.2k Views Asked by At

I have an app running on http://localhost:8081, which connects to backend running on http://localhost:8080 (the endpoint which it connects to is exactly on http://localhost:8080/stripe). When I move the backend to heroku, it works fine, but when I want to test it on localhost, I get an error strict-origin-when-cross-origin

Of course, I read this Stack Overflow question: Vue Axios CORS policy: No 'Access-Control-Allow-Origin' and many other articles and they all say the same: create a vue.config.js file and add

  module.exports = {
    devServer: {
      proxy: 'http://localhost:8080/'
    }
  }

to it. And so I do, but it doesn't help - I'm still getting this error. And now I don't know what to do. Is there any other reason why I keep getting this error?

0

There are 0 best solutions below