Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/nuxt/src/server/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@ export function init(options: SentryNuxtServerOptions): Client | undefined {
),
);

getGlobalScope().addEventProcessor(
Object.assign(
(event => {
if (event.exception?.values) {
const errorMsg = event.exception.values[0]?.value;
// The browser devtools try to get the source maps, but as client source maps may not be available there is going to be an error (no problem for the application though)
if (errorMsg?.match(/^ENOENT: no such file or directory, open '.*\/_nuxt\/.*\.js\.map'/)) {
options.debug && DEBUG_BUILD && logger.log('ClientSourceMapErrorFilter filtered error: ', errorMsg);
return null;
}
return event;
} else {
return event;
}
}) satisfies EventProcessor,
{ id: 'ClientSourceMapErrorFilter' },
),
);

return client;
}

Expand Down
Loading