阿波罗客户端3.xx,下一个JS,哨兵,strapi
我遇到一个问题,当我将sentry安装到我的下一个js项目时,我的apollo客户端3.xx突然出现CORS错误,但问题是它只在useQuery中给出CORS错误,而不是在useMutation中给出CORS错误。
Access to fetch at 'http://localhost:1337/graphql' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.
这很奇怪。我在 Sentry.init 中添加了集成选项
integrations: [
new BrowserTracing({
tracingOrigins: ["http://localhost:1337/graphql"],
}),
],
需要帮助!
I am facing an issue , when i installed sentry to my next js project , suddenly CORS error occured in my apollo client 3.x.x , but the thing is it only give CORS error in useQuery not in useMutation.
Access to fetch at 'http://localhost:1337/graphql' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.
its just weird. i have add option of integration in Sentry.init
integrations: [
new BrowserTracing({
tracingOrigins: ["http://localhost:1337/graphql"],
}),
],
Help Needed !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论