From 5c3b6bc0551ae3f25d5671db2be41a765162d807 Mon Sep 17 00:00:00 2001 From: sudosubin Date: Wed, 18 Aug 2021 20:09:30 +0900 Subject: [PATCH] feat: Change not to dependent on @sentry/tracing --- packages/nextjs/src/index.client.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nextjs/src/index.client.ts b/packages/nextjs/src/index.client.ts index e23464cf07d1..25398776c1c0 100644 --- a/packages/nextjs/src/index.client.ts +++ b/packages/nextjs/src/index.client.ts @@ -9,7 +9,7 @@ import { addIntegration, UserIntegrations } from './utils/userIntegrations'; export * from '@sentry/react'; export { nextRouterInstrumentation } from './performance/client'; -const { BrowserTracing } = TracingIntegrations; +const { BrowserTracing } = TracingIntegrations || {}; export const Integrations = { ...BrowserIntegrations, BrowserTracing }; /** Inits the Sentry NextJS SDK on the browser with the React SDK. */ @@ -33,12 +33,12 @@ export function init(options: NextjsOptions): void { }); } -const defaultBrowserTracingIntegration = new BrowserTracing({ - tracingOrigins: [...defaultRequestInstrumentationOptions.tracingOrigins, /^(api\/)/], - routingInstrumentation: nextRouterInstrumentation, -}); - function createClientIntegrations(integrations?: UserIntegrations): UserIntegrations { + const defaultBrowserTracingIntegration = new BrowserTracing({ + tracingOrigins: [...defaultRequestInstrumentationOptions.tracingOrigins, /^(api\/)/], + routingInstrumentation: nextRouterInstrumentation, + }); + if (integrations) { return addIntegration(defaultBrowserTracingIntegration, integrations, { BrowserTracing: { keyPath: 'options.routingInstrumentation', value: nextRouterInstrumentation },