0

Failed to load http://localhost:8080/***: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access. vue.esm.js?efeb:8566

  • 2
    Possible duplicate of [How does Access-Control-Allow-Origin header work?](https://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work) – Phil Sep 25 '18 at 06:17
  • @Phil how is this a duplicate? The question could have been better, but there's a solution specific to vuejs. – gyc Sep 25 '18 at 07:25
  • @gyc a CORS issue has absolutely nothing to do with Vue other than the fact that JavaScript running in a browser initiated a cross-domain HTTP request. The answers in the linked post explain clearly what is required of the server in this kind of interaction – Phil Sep 25 '18 at 07:26
  • @Phil So you're saying the link to the duplicate will help him solve his CORs issues in his vue project? – gyc Sep 25 '18 at 07:30
  • @gyc the issues aren't in his Vue project. They're in whatever project is running on port 8080 – Phil Sep 25 '18 at 07:33
  • I suppose this might help but only for running the local dev-server ~ https://cli.vuejs.org/config/#devserver-proxy – Phil Sep 25 '18 at 07:35
  • @Phil no this is wrong. He is on localhost, so just setting the correct headers in his requests will work. He needs to configure a proxy specific for his dev environment. Prod will come later. – gyc Sep 25 '18 at 07:38
  • @Phil finally you're trying to help a new contributor. Thanks. – gyc Sep 25 '18 at 07:39
  • @gyc any HTTP headers (other than Origin) to do with CORS are never set on the request – Phil Sep 25 '18 at 08:03

0 Answers0