Cannot redeclare block-scoped variable '__DEBUG_BUILD__'
See original GitHub issueEnvironment
How do you use Sentry? Sentry SaaS (sentry.io)
Which SDK and version?
@sentry/angular: ^7.11.0
@sentry/capacitor: ^0.9.0
Ionic:
Ionic Framework : @ionic/angular 5.9.1
@angular-devkit/build-angular : 0.1102.6
@angular-devkit/schematics : 11.2.7
@angular/cli : 11.2.6
@ionic/angular-toolkit : 2.3.3
Capacitor:
Capacitor CLI : 3.3.2
@capacitor/android : 3.3.2
@capacitor/core : 3.3.2
@capacitor/ios : 3.3.2
Steps to Reproduce
We’ve never used @sentry/capacitor and always used @sentry/angular for web only. I tried to implement @sentry/capacitor after having upgraded to Capacitor 3. However, when trying to build the mobile apps (Android/iOS) I get the following errors:
Error: node_modules/@sentry/capacitor/node_modules/@sentry/types/types/globals.d.ts:2:11 - error TS2451: Cannot redeclare block-scoped variable '__DEBUG_BUILD__'.
const __DEBUG_BUILD__: boolean;
node_modules/@sentry/types/types/globals.d.ts:2:11
const __DEBUG_BUILD__: boolean;
'__DEBUG_BUILD__' was also declared here.
Error: node_modules/@sentry/types/types/globals.d.ts:2:11 - error TS2451: Cannot redeclare block-scoped variable '__DEBUG_BUILD__'.
const __DEBUG_BUILD__: boolean;
node_modules/@sentry/capacitor/node_modules/@sentry/types/types/globals.d.ts:2:11
const __DEBUG_BUILD__: boolean;
'__DEBUG_BUILD__' was also declared here.
Issue Analytics
- State:
- Created a year ago
- Comments:8
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 >TS2451: Cannot redeclare block-scoped variable · Issue #249
Error: node_modules/@sentry/types/types/globals.d.ts:2:11 - error TS2451: Cannot redeclare block-scoped variable '__DEBUG_BUILD__'.
Read more >Cannot redeclare block-scoped variable? How to resolve
Cannot redeclare block -scoped variable? The Reason behind the error and the way to resolve it.
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
mmm if so I’ll bump the dependencies version this week.
Although the @sentry/types is the only one that causes a hard error, the following (peer)deps should probably be bumped to 7.12.0 as well:
“@sentry/angular”: “7.8.1”,
“@sentry/react”: “7.8.1”,
“@sentry/vue”: “7.8.1”
“@sentry/browser”: “7.8.1”,
“@sentry/core”: “7.8.1”,
“@sentry/hub”: “7.8.1”,
“@sentry/integrations”: “7.8.1”,
“@sentry/tracing”: “7.8.1”,
“@sentry/types”: “7.8.1”,
“@sentry/utils”: “7.8.1”,
“@sentry-internal/eslint-config-sdk”: “7.8.1”,
“@sentry-internal/eslint-plugin-sdk”: “7.8.1”,
Besides that “@sentry/wizard” and “@sentry/typescript” might need to be bumped as well (although I am not 100% sure about this)