TS2451: Cannot redeclare block-scoped variable
See original GitHub issueIs there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
SDK Version
7.16.0
Framework Version
Angular 13.3.11 & Ionic 6.3.2
Link to Sentry event
No response
Steps to Reproduce
Node.js v16.10.x
Typescript 4.5.x
Currently we are using the following versions of Sentry package: “@sentry/angular”: “^6.19.7”, “@sentry/capacitor”: “^0.6.1”, “@sentry/tracing”: “^6.19.7”
After trying to bump all packages to latest i.e.: “@sentry/angular”: “^7.16.0”, “@sentry/capacitor”: “^0.10.1”, “@sentry/tracing”: “^7.16.0”
Expected Result
No error
Actual Result
I receive the following error:
Error: node_modules/@sentry/types/types/globals.d.ts:2:11 - error TS2451: Cannot redeclare block-scoped variable '__DEBUG_BUILD__'.
2 const __DEBUG_BUILD__: boolean;
~~~~~~~~~~~~~~~
node_modules/@sentry/tracing/node_modules/@sentry/types/types/globals.d.ts:2:11
2 const __DEBUG_BUILD__: boolean;
~~~~~~~~~~~~~~~
'__DEBUG_BUILD__' was also declared here.
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Cannot redeclare block scoped variable - Stack Overflow
It happens when variable co is already defined in the scope (maybe window/global object has it) and you ...
Read more >[SOLVED] Cannot Redeclare Block-Scoped Variable in ...
The “Cannot redeclare block-scoped variable” error occurs if you declare a variable with a name that clashes with one declared in TypeScript ......
Read more >TypeScript and the Error: Cannot Redeclare Block Scoped ...
Hi, Devs! Who are getting start in Typescript could face this error: "Cannot Redeclare Block Scoped Variable Name" and it means a concept ......
Read more >SOLVED TypeScript Cannot Redeclare Block Scoped ...
Solution for an issue that says cannot redeclare block scoped variable name in TypeScript.
Read more >Cannot redeclare block-scoped variable? How to resolve
Typescript is moduler and each module has it's own block. So, basically if you could somehow enclose the variable which is declared as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To fix this you must use a fixed sibling version of angular and tracing
Additionally, at the moment the SDK is compatible with version 7.13.0.
Hopefully this situation will get clearer on the next versions of Sentry Capacitor
Just to let you know, fixing the versions as specified above does work - thank you @lucas-zimerman.