Skip to content

The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mayordwells opened this issue Aug 8, 2017 · 7 comments

Comments

@mayordwells
Copy link

mayordwells commented Aug 8, 2017

I have no idea where this error with CORS is coming from and I have no idea how to fix it.
I created a new Rails app using the Angular webpacker flag. (Rails v5.1.3, Angular v4.3.3)
Everything works perfectly well except that I'm getting this endless log of CORS error in my console.
screen shot 2017-08-08 at 4 36 55 pm

How can I make this error go away?

@renchap
Copy link
Contributor

renchap commented Aug 8, 2017

This is a bug in the last webpack-dev-server version, released today. It is caused by this PR: webpack/webpack-dev-server#911

I am opening a bug for this, in the meantime you can stick to the previous version:
yarn add [email protected]

@renchap
Copy link
Contributor

renchap commented Aug 8, 2017

@shellscape
Copy link

I commented on the linked issue there, but if anyone here can provide a small example app which reproduces this error, I'd be happy to take a look at it.

@renchap
Copy link
Contributor

renchap commented Aug 8, 2017

webpack-dev-server 2.7.1 has just been released and fixed this issue.

@nengine
Copy link

nengine commented Sep 26, 2017

I am using webpack with Vue.js template inside Rails 5.1 app and calling publicClient.getProducts() methods works fine. But, to stream the data, when I open websocket connection I am getting:

"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ws-feed.gdax.com/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)."

Is this something has to do with Rails or Vue.js? Any help is greatly appreciated.

<template>
  <div id="trades">
    <p>{{ message }}</p>
    <button @click='load'>Load data</button>    
  </div>
</template>

<script>
  const Gdax = require('gdax');
  const publicClient = new Gdax.PublicClient();
  const websocket = new Gdax.WebsocketClient(['LTC-USD']);

  export default {
    data: function() {
      return {
        message: 'Hello from trades Vue'
      }
    },
    methods: {
      mounted: function() {
        websocket.on('message', data => {
          console.log(data);
        });    
      },

      load: function() {     
        publicClient.getProducts((error, response, data) => {
          if (error) {
            // handle the error
          } else {
            console.log(JSON.stringify(data));
          }
        });
      }
    }
  }
</script>

@gauravtiwari
Copy link
Member

@nengine Nope, seems like something related to https://ws-feed.gdax.com/.

@rajranjan672
Copy link

@renchap i am still not able to fix error after installing the, webpack-dev-server 2.7.1 can someone help me in fixing the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants