Fetch API cannot load https://dc.services.visualstudio.com/v2/track. Request header field content-encoding is not allowed by Access-Control-Allow-Headers in preflight response.
See original GitHub issueI am trying to integrate npm’s application insights module (https://www.npmjs.com/package/applicationinsights) into my React js application.
My source for doing this is:
import appInsights from 'applicationinsights';
appInsights.setup(applicationInsightsKey).start();
The problem I got is that in my Chrome Developer tools I can see a preflight request made to https://dc.services.visualstudio.com/v2/track. But in the console I can see the following error:
"Fetch API cannot load https://dc.services.visualstudio.com/v2/track. Request header field content-encoding is not allowed by Access-Control-Allow-Headers in preflight response."
Do you have an idea how can I fix this issue?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Microsoft - Bountysource
Fetch API cannot load https://dc.services.visualstudio.com/v2/track. Request header field content-encoding is not allowed by Access-Control- ...
Read more >Access-Control-Allow-Headers - HTTP - MDN Web Docs
The Access-Control-Allow-Headers response header is used in response to a preflight request which includes the ...
Read more >CORS Headers problems | Apple Developer Forums
Hello,. I have a very strange problem, only on safari. I have set up cross-origin access on my api, and it doesn't only...
Read more >ASP.NET Core CORS middleware doesn't return all headers ...
Im using ASP.NET Core with UseCors() . How do I get it to list all headers specified in WithHeaders() in Access-Control-Allow-Headers ? In ......
Read more >Fetch: Cross-Origin Requests - The Modern JavaScript Tutorial
E.g. an evil script from website hacker.com could not access the ... to read the Content-Encoding and API-Key headers of the response.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I can see a call to https://dc.services.visualstudio.com/v2/track with HTTP verb OPTIONS which has a response HTTP 200 - OK.
@SergeyKanzhelev I switched to https://github.com/Microsoft/ApplicationInsights-JS and it works good for me.