wangweianger/web-report-sdk

zanePerfor与Sentry同时使用会出现无限循环报错

Sapphire2k opened this issue · 0 comments

看了一下报错信息是因为Sentry会监听fetch Api的报错

https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/breadcrumbs.ts

/** JSDoc */
  private _instrumentFetch()

  ...
       const fetchData: {
          method: string;
          url: string;
          status_code?: number;
        } = {
          method: isString(method) ? method.toUpperCase() : method,
          url,
        };

        return originalFetch
          .apply(global, args)
          .then((response: Response) => {
            fetchData.status_code = response.status;
            Breadcrumbs.addBreadcrumb(
              {
                category: 'fetch',
                data: fetchData,
                type: 'http',
              },
              {
                input: args,
                response,
              },
            );
            return response;
          })

主要是这里的responseundefined,获取status的时候就报错了,然后就出现zanePerfor、Sentry无限报错