Apollo-client: has been blocked by CORS policy: Request header field apollographql-client-version is not allowed by Access-Control-Allow-Headers in preflight response.

Created on 21 Nov 2018  ·  14Comments  ·  Source: apollographql/apollo-client

Actual outcome:

the request headers preflight is broke with the follow answer has been blocked by CORS policy: Request header field apollographql-client-version is not allowed by Access-Control-Allow-Headers in preflight response.

How to reproduce the issue:

Installing dependencies via yarn install

Versions

react-apollo: "^2.2.2

✔ confirmed 🐞 bug 🚨 high-priority

Most helpful comment

Updating to apollo-link-http 1.5.7 should fix this issue. Let me know if it doesn't - thanks!

All 14 comments

I have also gotten caught by this after I updated my dependencies (apollo-client from 2.4.5 to 2.4.7) just now. How do I turn off requesting these headers?

:+1:, furthermore, when allowed - there is undefined

Same issue here, I've tried downgrading but it didn't fix anything. Maybe an internal dependency?

This is happening to me as well, this is very recent

I have 4 projects using apollo-client and the issue began yesterday, I saw it using CI and in the building process, all my projects has crashed. luckily I was able to reconstruct some, doing the build from my local machine. But is impossible to deploy right now. I consider it's a critical issue. Many projects run with CI and in their node_modules build process, it will to crash their applications. Any help is welcome.

Same issue here, I've tried downgrading but it didn't fix anything. Maybe an internal dependency?

I believe it is the issue

The apollographql-client-version header was added in a recent apollo-link-http update (https://github.com/apollographql/apollo-link/pull/872). I see the issue, and am working on a fix. It will be ready in a few minutes, at which point updating your version of apollo-link-http should fix the issue.

Updating to apollo-link-http 1.5.7 should fix this issue. Let me know if it doesn't - thanks!

@hwillson Hi, i'm experiencing the same error with version 1.5.9 of apollo-link-http, should i downgrade to 1.5.7?

@hwillson I'm also experiencing the same issue with the following versions:

"apollo-client": "^2.4.12", "apollo-link-http": "^1.5.9",

I have tried to downgrade to 1.5.7 but no luck. 😞

I have fixed it. The issue was the Apollo-server was overriding the cors settings I had. Thanks!

I'm only using Next.js with express, and have the same error :/

Experiencing the same issue.

apollo-client: ^2.6.8
apollo-link-http: ^1.5.16

I believe the package apollo-link-batch-http: 1.2.13 has the same issue

Was this page helpful?
0 / 5 - 0 ratings