Skip to content

[Ember] Type Problem Introduced in v6.10? #4172

Closed
@jherdman

Description

@jherdman

Package + Version

  • @sentry/browser:
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other: @sentry/ember

Version:

6.10.0+

Description

In upgrading an application using @sentry/ember v6.6.0 to v6.15 we ran into some peculiar type regressions. Here's a snippet of our code that worked before:

    assert(
      '[ember-metrics] You must configure Heap adapter. See documentation.',
      typeof config !== 'undefined'
    );

    const { appId, pageViewPrefix } = config;

Using v6.6.0 this code works, but suddenly, when v6.10 (or later), is introduced we see the type for assert fail.

I'm not entirely sure this is the problem, but this is a bit of a smoking gun:

declare module '@ember/debug' {
export function assert(desc: string, test: unknown): void;
}

Note that this typing differs from the DefinitelyTyped version:

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4a4f37536cec0d38819acd9015600de7715ac6b3/types/ember__debug/index.d.ts#L10-L14

I believe that If you were to use the @types/ember__debug package instead of rolling your own type this problem should be resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: emberIssues related to the Sentry Ember SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions