阿波罗客户端3.xx,下一个JS,哨兵,strapi

发布于 2025-01-20 03:00:49 字数 564 浏览 2 评论 0原文

我遇到一个问题,当我将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文