question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript error for RewriteFrames integration with version 5.10.0

See original GitHub issue

Package + Version

@sentry/electron”: “^1.0.0”, “@sentry/integrations”: “^5.10.0”,

Description

The code in question:

Sentry.init({
    dsn: sentryDsn,
    beforeSend(event: any) {
        // Check if it is an exception, and if so, show the report dialog
        if (event.exception) {
            console.log(`showing dialog`);
            Sentry.showReportDialog({ eventId: event.event_id });
        }
        return event;
    },
    integrations: [
        new RewriteFrames({
            root: global.__rootdir__,
        }),
    ],
});

With version 5.10.0, I get a typescript error for the integrations field in Sentry.init’s config:

Type 'RewriteFrames[]' is not assignable to type 'Integration[] | ((integrations: Integration[]) => Integration[])'.
  Type 'RewriteFrames[]' is not assignable to type 'Integration[]'.
    Type 'RewriteFrames' is not assignable to type 'Integration'.
      Types of property 'setupOnce' are incompatible.
        Type '(addGlobalEventProcessor: (callback: import("/Users/bjaffe/Repos/branch-manager/node_modules/@sentry/integrations/node_modules/@sentry/types/dist/eventprocessor").EventProcessor) => void, getCurrentHub: () => import("/Users/bjaffe/Repos/branch-manager/node_modules/@sentry/integrations/node_modules/@sentry/types/dist...' is not assignable to type '(addGlobalEventProcessor: (callback: import("/Users/bjaffe/Repos/branch-manager/node_modules/@sentry/types/dist/eventprocessor").EventProcessor) => void, getCurrentHub: () => import("/Users/bjaffe/Repos/branch-manager/node_modules/@sentry/types/dist/hub").Hub) => void'.
          Types of parameters 'addGlobalEventProcessor' and 'addGlobalEventProcessor' are incompatible.
            Types of parameters 'callback' and 'callback' are incompatible.
              Type 'import("/Users/bjaffe/Repos/branch-manager/node_modules/@sentry/integrations/node_modules/@sentry/types/dist/eventprocessor").EventProcessor' is not assignable to type 'import("/Users/bjaffe/Repos/branch-manager/node_modules/@sentry/types/dist/eventprocessor").EventProcessor'.
                Types of parameters 'event' and 'event' are incompatible.
                  Type 'import("/Users/bjaffe/Repos/branch-manager/node_modules/@sentry/types/dist/event").Event' is not assignable to type 'import("/Users/bjaffe/Repos/branch-manager/node_modules/@sentry/integrations/node_modules/@sentry/types/dist/event").Event'.
                    Types of property 'type' are incompatible.
                      Type '"none"' is not assignable to type '"transaction"'.ts(2322)
options.d.ts(33, 5): The expected type comes from property 'integrations' which is declared here on type 'ElectronOptions'

This issue goes away when I downgrade to version 5.8.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
colthreepvcommented, Dec 16, 2019

It happened to me as well when @sentry/node and @sentry/integrations were not synced up.
In my specific case:

"@sentry/integrations": "^5.4.2",
"@sentry/node": "^5.10.2",

This situation was created following an npm audit fix
Force-updating @sentry/integrations to latest fixed it for me (npm i --save @sentry/integrations)

0reactions
dalenguyencommented, Jan 8, 2020

It happened to me as well when @sentry/node and @sentry/integrations were not synced up. In my specific case:

"@sentry/integrations": "^5.4.2",
"@sentry/node": "^5.10.2",

This situation was created following an npm audit fix Force-updating @sentry/integrations to latest fixed it for me (npm i --save @sentry/integrations)

It’s true. Updating @sentry to the latest fixes this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

rewriteframes.min.js.map - sentry/integrations - UNPKG
@sentry/integrations/build/rewriteframes.min.js.map. Version: ... */\nexport class SentryError extends Error {\n /** Display name of this error instance.
Read more >
@sentry-internal/typescript | Yarn - Package Manager
The Replay version bump is the result of moving the package into the Sentry JavaScript SDK monorepo which aligns the version with our...
Read more >
JavaScript - Docs - Sentry Documentation
This integration allows you to configure linked errors. They'll be recursively read up to a specified limit and lookup will be performed by...
Read more >
How to Add Sentry to Your Node.js Project with TypeScript
Sentry.io is an external monitoring and logging service which can help you identify and triage errors in your code.
Read more >
CDN for JavaScript - Sentry Documentation
Version 7 of the Sentry JavaScript SDKs changed the bundles to be ES6 by default. ... rewriteframes.es5.min.js is the RewriteFrames integration, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found