Azure Applications Insights节点js模块不工作- Fetch API无法加载错误
Azure Applications Insights node js module not working - Fetch API cannot load error
我正在尝试将npm的应用程序洞察模块(https://www.npmjs.com/package/applicationinsights)集成到我的React js应用程序中。
我这样做的来源是:
import appInsights from 'applicationinsights';
appInsights.setup(applicationInsightsKey).start();
我得到的问题是,在我的Chrome开发人员工具,我可以看到一个飞行前的请求https://dc.services.visualstudio.com/v2/track。但是在控制台中,我可以看到以下错误:
"取回API无法加载https://dc.services.visualstudio.com/v2/track。请求报头字段内容编码不被允许pre - flight响应中的Access-Control-Allow-Headers。"
你知道如何解决这个问题吗?
你正在使用的node.js模块是node.js服务器的AI SDK。由于React js应用程序是javascript中的客户端应用程序,因此在技术上它们是不同的。
请尝试使用ApplicationInsights-JS。
此外,您可以参考https://azure.microsoft.com/en-us/documentation/articles/app-insights-web-track-usage/获取更多信息。
相关文章:
- IE11中的第二个调用取消了第一个Fetch API调用
- ajaxStart和ajaxStop等同于fetch API
- Fetch Api无法从PHP服务器获取会话
- Javascript fetch API in react-flux
- JavaScript 的 Fetch API 的“同源”和“no-cors”有什么区别?
- Fetch API and Cordova
- 预检请求失败,并显示 window.fetch api
- JS Fetch api and Symfony2 FOSRestBundle
- Blogger JSON API Post fetch and Content Parse
- 如何在PHP中使用fetch()API POST方法获取数据
- Azure Applications Insights节点js模块不工作- Fetch API无法加载错误
- Service worker fetch事件不是由Google API请求触发的
- 如何使用模式'no-cors'的fetch API获取数据
- 在fetch api调用时未设置标头
- Javascript -使用fetch查询voldb api
- 在ReactNative应用程序中使用fetch API忽略自签名SSL证书的错误
- Babel将新的Request (fetch-api)转换为函数调用,导致Chrome出现错误
- Fetch API post永远不会落入.then
- 如何将Fetch API的值传递给变量
- Javascript中的Fetch API返回[object, object]