Typescript error for RewriteFrames integration with version 5.10.0
See original GitHub issuePackage + 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:
- Created 4 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It happened to me as well when
@sentry/node
and@sentry/integrations
were not synced up.In my specific case:
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.