Skip to content

Module '"@sentry/nextjs"' has no exported member 'BrowserTracing'. #4569

@seanparmelee

Description

@seanparmelee

Hello 👋
I just updated to Sentry 6.17.7 and saw that BrowserTracing has since been directly exported through @sentry/nextjs so I went to update my sentry.client.config.ts file:

-import { Integrations } from '@sentry/tracing';
+import { BrowserTracing } from '@sentry/nextjs';
-integrations: [new Integrations.BrowserTracing(), new OfflineIntegration()],
+integrations: [new BrowserTracing(), new OfflineIntegration()],

But TypeScript is complaining about the import, saying

Module '"@sentry/nextjs"' has no exported member 'BrowserTracing'. ts(2305)

It seems TypeScript is looking in the server index file, rather than the client. I'm not sure there's a good way around this at the moment, aside from ignoring this error or also exporting BrowserTracing from the server file. I did come across microsoft/TypeScript#29128 which seems like what we'd need here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions