Skip to content

Class 'SyncPromise<T>' incorrectly implements interface 'Promise<T>'. for @sentry/browser@5.7.0 #2265

Closed

Description

@Rdbaker

Package + Version

  • @sentry/browser - 5.7.0

Version:

5.7.0

Description

Our typescript app failed the build when compiled with the latest sentry/browser (5.7.0)

ERROR in node_modules/@sentry/utils/dist/syncpromise.d.ts(5,22):
error TS2420: Class 'SyncPromise<T>' incorrectly implements interface 'Promise<T>'.
    Types of property '[Symbol.toStringTag]' are incompatible.
    Type 'string' is not assignable to type '"Promise"'.

I noticed that this only happened when we picked up the latest release, let me know if you need other information to reproduce. We're using typescript version 2.4.2

Activity

  1. kamilogorek commented on Oct 11, 2019

    @kamilogorek
    Contributor

    I did some research, and apparently this was an issue with TypeScript prior to version 3.2, which has been patched since then: microsoft/TypeScript#24396

    I'm not sure how to approach this yet. As on the one hand interface requires this to be there, but if we'll use Promise as old TypeScript versions requires us to, it'd be impossible to make a distinction between our and native implelmentation using symbols.

  2. tolzhabayev commented on Oct 13, 2019

    @tolzhabayev

    +1 we are having exact the same problem, upgrading TypeScript to version 3 is currently not possible. We had to go back to version 5.6.* of sentry/browser.

  3. kamilogorek commented on Oct 15, 2019

    @kamilogorek
    Contributor

    Fixed in 5.7.1

  4. kamilogorek commented on Oct 15, 2019

    @kamilogorek
    Contributor

    @tolzhabayev including TS2 :)

  5. tolzhabayev commented on Oct 27, 2019

    @tolzhabayev

    @tolzhabayev including TS2 :)

    thank you!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions