-
Notifications
You must be signed in to change notification settings - Fork 50
Closed
Description
We inject code that creates a new variable called _global:
sentry-javascript-bundler-plugins/packages/bundler-plugin-core/src/utils.ts
Lines 317 to 329 in b2a0529
| let code = ` | |
| var _global = | |
| typeof window !== 'undefined' ? | |
| window : | |
| typeof global !== 'undefined' ? | |
| global : | |
| typeof globalThis !== 'undefined' ? | |
| globalThis : | |
| typeof self !== 'undefined' ? | |
| self : | |
| {}; | |
| _global.SENTRY_RELEASE={id:${JSON.stringify(release)}};`; |
There is a chance this can clash with user code if that variable name is used.
We should either chose a variable name that is more unique and less likely to clash with user code or wrap this code block in a closure so that the scope is private.
Metadata
Metadata
Assignees
Labels
No labels