Skip to content

Ionic setup fails out of the box / Compile error: Cannot redeclare block-scoped variable __DEBUG_BUILD__ #394

@zarko-tg

Description

@zarko-tg

Environment

Following the instructions from https://docs.sentry.io/platforms/javascript/guides/capacitor/ionic/

Node 18.16.1
macOS Ventura 13.4.1
Installed global @ionic/cli@7.1.1

Steps to Reproduce

  1. Created a fresh Ionic 7 / Angular 16 / Capacitor 5 project using "ionic start".
  2. Followed the instructions from the docs link above.
  3. ionic serve

Yields:

[ng] Error: node_modules/@sentry/capacitor/node_modules/@sentry/types/types/globals.d.ts:2:11 - error TS2451: Cannot redeclare block-scoped variable '__DEBUG_BUILD__'.
[ng]
[ng] 2     const __DEBUG_BUILD__: boolean;
[ng]             ~~~~~~~~~~~~~~~
[ng]
[ng]   node_modules/@sentry/types/types/globals.d.ts:2:11
[ng]     2     const __DEBUG_BUILD__: boolean;
[ng]                 ~~~~~~~~~~~~~~~
[ng]     '__DEBUG_BUILD__' was also declared here.
[ng]
[ng]
[ng] Error: node_modules/@sentry/types/types/globals.d.ts:2:11 - error TS2451: Cannot redeclare block-scoped variable '__DEBUG_BUILD__'.
[ng]
[ng] 2     const __DEBUG_BUILD__: boolean;
[ng]             ~~~~~~~~~~~~~~~
[ng]
[ng]   node_modules/@sentry/capacitor/node_modules/@sentry/types/types/globals.d.ts:2:11
[ng]     2     const __DEBUG_BUILD__: boolean;
[ng]                 ~~~~~~~~~~~~~~~
[ng]     '__DEBUG_BUILD__' was also declared here.

sentest.zip

Attached you can find a reproduction project, where after unpacking you just run: npm i && ionic serve

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions