Skip to content

Commit e35ed53

Browse files
committed
Fix sentry error ignoring
1 parent 1c7d82b commit e35ed53

File tree

9 files changed

+38
-34
lines changed

9 files changed

+38
-34
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
"husky": "^2.2.0",
8686
"lerna": "^3.16.4",
8787
"lint-staged": "^9.2.5",
88-
"prettier": "1.18.2",
88+
"prettier": "1.19.0",
8989
"pretty-quick": "^1.10.0",
90-
"typescript": "3.7.1-rc",
90+
"typescript": "3.7.2",
9191
"username": "^5.1.0"
9292
},
9393
"husky": {

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
"terser": "^4.1.4",
313313
"terser-webpack-plugin": "^1.4.1",
314314
"thread-loader": "^2.1.2",
315-
"typescript": "3.7.1-rc",
315+
"typescript": "3.7.2",
316316
"url-loader": "1.0.1",
317317
"webpack": "^4.36.1",
318318
"webpack-bundle-analyzer": "^2.13.1",

packages/codesandbox-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"tslint-config-prettier": "^1.1.0",
9595
"tslint-config-standard": "^6.0.0",
9696
"typedoc": "^0.7.1",
97-
"typescript": "3.7.1-rc",
97+
"typescript": "3.7.2",
9898
"uuid": "^3.3.2",
9999
"validate-commit-msg": "^2.12.2"
100100
},

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"jest-styled-components": "^6.3.3",
109109
"jest-svg-transformer": "^1.0.0",
110110
"rimraf": "^2.6.3",
111-
"typescript": "3.7.1-rc",
111+
"typescript": "3.7.2",
112112
"yarn": "^1.17.3"
113113
}
114114
}
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import VERSION from '../../version';
22
import { DO_NOT_TRACK_ENABLED } from './utils';
33

4-
let _Sentry;
4+
let _Sentry: typeof import('@sentry/browser');
55

6-
function getSentry() {
6+
function getSentry(): Promise<typeof import('@sentry/browser')> {
77
return import(/* webpackChunkName: 'sentry' */ '@sentry/browser');
88
}
99

@@ -18,7 +18,12 @@ export async function initialize(dsn: string) {
1818
'Custom Object', // Called for errors coming from sandbox (https://sentry.io/organizations/codesandbox/issues/965255074/?project=155188&query=is%3Aunresolved&statsPeriod=14d)
1919
'TypeScript Server Error', // Called from the TSC server
2020
/^Canceled$/, // Used by VSCode to stop currently running actions
21+
22+
// Chrome extensions
23+
/extensions\//i,
24+
/^chrome:\/\//i,
2125
],
26+
whitelistUrls: [/https?:\/\/((uploads|www)\.)?codesandbox\.io/],
2227
/**
2328
* Don't send messages from the sandbox, so don't send from eg.
2429
* new.codesandbox.io or new.csb.app
@@ -29,10 +34,7 @@ export async function initialize(dsn: string) {
2934
/.*\.csb\.app/,
3035
],
3136
beforeSend: (event, hint) => {
32-
if (
33-
event?.stacktrace?.frames &&
34-
event.stacktrace.frames[0]
35-
) {
37+
if (event?.stacktrace?.frames && event.stacktrace.frames[0]) {
3638
const { filename } = event.stacktrace.frames[0];
3739

3840
if (
@@ -41,7 +43,7 @@ export async function initialize(dsn: string) {
4143
event.message.includes('too much recursion')
4244
) {
4345
// https://sentry.io/organizations/codesandbox/issues/1293123855/events/b01ee0feb7e3415a8bb81b6a9df19152/?project=155188&query=is%3Aunresolved&statsPeriod=14d
44-
return undefined;
46+
return null;
4547
}
4648

4749
if (
@@ -51,13 +53,13 @@ export async function initialize(dsn: string) {
5153
// This is the spammy event that doesn't do anything: https://sentry.io/organizations/codesandbox/issues/1054971728/?project=155188&query=is%3Aunresolved
5254
// Don't do anything with it right now, I can't seem to reproduce it for some reason.
5355
// We need to add sourcemaps
54-
return undefined;
56+
return null;
5557
}
5658

5759
if (filename.includes('react-devtools-inline')) {
5860
// Outside of our scope for now, but we definitely want to check this out.
5961
// TODO: check what's happening here: https://sentry.io/organizations/codesandbox/issues/1239466583/?project=155188&query=is%3Aunresolved+release%3APROD-1573653062-4134efc0a
60-
return undefined;
62+
return null;
6163
}
6264
}
6365

@@ -70,19 +72,17 @@ export async function initialize(dsn: string) {
7072
event.message.startsWith('Non-Error exception captured')
7173
) {
7274
// This is an error coming from the sandbox, return with no error.
73-
return undefined;
75+
return null;
7476
}
7577

7678
if (
7779
event.message &&
7880
event.message.includes('Unexpected frame by generating stack.')
7981
) {
8082
// A firefox error with error-polyfill, not critical. Referenced here: https://sentry.io/organizations/codesandbox/issues/1293236389/?project=155188&query=is%3Aunresolved
81-
return undefined;
83+
return null;
8284
}
8385

84-
85-
8686
return event;
8787
},
8888
});
@@ -91,30 +91,30 @@ export async function initialize(dsn: string) {
9191
return Promise.resolve();
9292
}
9393

94-
export const captureException = (err) => {
94+
export const captureException = err => {
9595
if (_Sentry) {
9696
_Sentry.captureException(err);
9797
}
98-
}
98+
};
9999

100-
export const configureScope = (cb) => {
100+
export const configureScope = cb => {
101101
if (_Sentry) {
102102
_Sentry.configureScope(cb);
103-
}
104-
}
103+
}
104+
};
105105

106-
export const setUserId = (userId) => {
106+
export const setUserId = userId => {
107107
if (_Sentry) {
108108
_Sentry.configureScope(scope => {
109109
scope.setUser({ id: userId });
110110
});
111111
}
112-
}
112+
};
113113

114114
export const resetUserId = () => {
115115
if (_Sentry) {
116116
_Sentry.configureScope(scope => {
117117
scope.setUser({ id: undefined });
118118
});
119119
}
120-
}
120+
};

packages/executors/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"@types/jest": "^24.0.13",
4040
"@types/socket.io-client": "^1.4.32",
4141
"husky": "^2.4.0",
42-
"prettier": "^1.18.2",
4342
"pretty-quick": "^1.11.0",
4443
"tsdx": "^0.6.1",
4544
"tslib": "^1.9.3",

standalone-packages/react-sandpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"tslint-config-prettier": "^1.1.0",
127127
"tslint-config-standard": "^7.0.0",
128128
"typedoc": "^0.10.0",
129-
"typescript": "3.7.1-rc",
129+
"typescript": "3.7.2",
130130
"validate-commit-msg": "^2.12.2"
131131
},
132132
"peerDependencies": {

standalone-packages/sandpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"tslint-config-prettier": "^1.1.0",
9696
"tslint-config-standard": "^7.0.0",
9797
"typedoc": "^0.11.1",
98-
"typescript": "3.7.1-rc",
98+
"typescript": "3.7.2",
9999
"validate-commit-msg": "^2.12.2"
100100
},
101101
"engines": {

yarn.lock

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20725,7 +20725,12 @@ preserve@^0.2.0:
2072520725
version "0.2.0"
2072620726
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
2072720727

20728-
[email protected], prettier@^1.14.2, prettier@^1.14.3, prettier@^1.16.4, prettier@^1.17.0, prettier@^1.18.2:
20728+
20729+
version "1.19.0"
20730+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.0.tgz#3bec4489d5eebcd52b95ddd2c22467b5c852fde1"
20731+
integrity sha512-GlAIjk6DjkNT6u/Bw5QCWrbzh9YlLKwwmJT//1YiCR3WDpZDnyss64aXHQZgF8VKeGlWnX6+tGsKSVxsZT/gtA==
20732+
20733+
prettier@^1.14.2, prettier@^1.14.3, prettier@^1.16.4, prettier@^1.17.0:
2072920734
version "1.18.2"
2073020735
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
2073120736
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==
@@ -25841,10 +25846,10 @@ [email protected]:
2584125846
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.4.tgz#3d38321828231e434f287514959c37a82b629f42"
2584225847
integrity sha1-PTgyGCgjHkNPKHUUlZw3qCtin0I=
2584325848

25844-
25845-
version "3.7.1-rc"
25846-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.1-rc.tgz#2054b872d67f8dc732e36c1df397f9327f37ada0"
25847-
integrity sha512-2rMtWppLsaPvmpXsoIAXWDBQVnJMw1ITGGSnidMuayLj9iCmMRT69ncKZw/Mk5rXfJkilApKucWQZxproALoRw==
25849+
25850+
version "3.7.2"
25851+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb"
25852+
integrity sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==
2584825853

2584925854
typography-breakpoint-constants@^0.15.10:
2585025855
version "0.15.10"

0 commit comments

Comments
 (0)