-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Only import
inspector
asynchronously (#12231)
Closes #12223 I've added a test that uses `import-in-the-middle` to throw if `inspector` is imported without enabling the `LocalVariables` integration so this should not regress in the future. Note that we don't need to import asynchronously in the worker scripts since these are not evaluated if the features aren't used.
- Loading branch information
Showing
6 changed files
with
135 additions
and
110 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
dev-packages/node-integration-tests/suites/public-api/LocalVariables/deny-inspector.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as Sentry from '@sentry/node'; | ||
import Hook from 'import-in-the-middle'; | ||
|
||
Hook((_, name) => { | ||
if (name === 'inspector') { | ||
throw new Error('No inspector!'); | ||
} | ||
if (name === 'node:inspector') { | ||
throw new Error('No inspector!'); | ||
} | ||
}); | ||
|
||
Sentry.init({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters