Skip to content

"RewriteFrames is not a constructor" when attempting to add sentry to a TypeScript app #2021

Closed
@mtthwhggns

Description

@mtthwhggns

Package + Version

  • @sentry/browser - "^5.0.6"
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.0.6

Description

I followed the guidance in here; https://docs.sentry.io/platforms/node/typescript/ to add Sentry and send source maps from a React + TypeScript app.

I define global.__rootdir__, as the docs suggest, but, and as per the page from the docs, add the following to one of the earliest loaded files;

Sentry.init({
  dsn: '',
  integrations: [new Sentry.Integrations.RewriteFrames({
    root: global.__rootdir__
  })]
});

Now, when starting the app, it gives the following;

UnhandledPromiseRejectionWarning: TypeError: a.Integrations.RewriteFrames is not a constructor

I've also tried removing the whole integrations part from Sentry.init. When I do this, errors get reported correctly, and the "source maps" get uploaded (so I'm satisfied that everything else seems to be working), but the backtraces remain unreadable.

Have I missed something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions