Skip to content

Commit 7eaa0a3

Browse files
committed
Disable error reporting from the sandbox
1 parent bbfd2c0 commit 7eaa0a3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/common/src/utils/analytics.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function getSentry() {
2121
return import(/* webpackChunkName: 'sentry' */ '@sentry/browser');
2222
}
2323
export async function initializeSentry(dsn: string) {
24-
const Sentry = await getSentry();
2524
if (!DNT) {
2625
sentryInitialized = true;
26+
const Sentry = await getSentry();
2727

2828
return Sentry.init({
2929
dsn,
@@ -33,8 +33,15 @@ export async function initializeSentry(dsn: string) {
3333
'TypeScript Server Error', // Called from the TSC server
3434
/^Canceled$/, // Used by VSCode to stop currently running actions
3535
],
36+
/**
37+
* Don't send messages from the sandbox, so don't send from eg.
38+
* new.codesandbox.io or new.csb.app
39+
*/
40+
blacklistUrls: [/.*\.codesandbox\.io/, /.*\.csb\.app/],
3641
});
3742
}
43+
44+
return Promise.resolve();
3845
}
3946

4047
export async function logError(err: Error) {

0 commit comments

Comments
 (0)