Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron with Angular cannot init #583

Closed
6 of 7 tasks
MikeJerred opened this issue Nov 3, 2022 · 2 comments · Fixed by #584
Closed
6 of 7 tasks

Electron with Angular cannot init #583

MikeJerred opened this issue Nov 3, 2022 · 2 comments · Fixed by #584
Assignees

Comments

@MikeJerred
Copy link

MikeJerred commented Nov 3, 2022

Versions + Platform

  • SDK version - @sentry/electron@v4.1.0
  • Electron version - electron@v19.0.14
  • Platform - Windows

Description

Using:

"@angular/core": "^14.2.1",
"@sentry/angular": "^7.17.3",
"@sentry/electron": "^4.1.0",

When I import like this:

import { init as sentryAngularInit} from '@sentry/angular';
import { init as sentryInit } from '@sentry/electron/renderer';

sentryInit({ dsn: '...' }, sentryAngularInit);

I get a type error:

Argument of type '(options: import("d:/dev/projects/glint/angular/node_modules/@sentry/browser/types/client").BrowserOptions) => void' is not assignable to parameter of type '(options: import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/browser/types/client").BrowserOptions) => void'.
  Types of parameters 'options' and 'options' are incompatible.
    Type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/browser/types/client").BrowserOptions' is not assignable to type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/browser/types/client").BrowserOptions'.
      Types of property 'defaultIntegrations' are incompatible.
        Type 'false | import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/integration").Integration[] | undefined' is not assignable to type 'false | import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/integration").Integration[] | undefined'.
          Type 'Integration[]' is not assignable to type 'false | Integration[] | undefined'.
            Type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/integration").Integration[]' is not assignable to type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/integration").Integration[]'.
              Type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/integration").Integration' is not assignable to type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/integration").Integration'.
                Types of property 'setupOnce' are incompatible.
                  Type '(addGlobalEventProcessor: (callback: import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/eventprocessor").EventProcessor) => void, getCurrentHub: () => import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/hub").Hub) => v...' is not assignable to type '(addGlobalEventProcessor: (callback: import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/eventprocessor").EventProcessor) => void, getCurrentHub: () => import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/hub").Hub) => void'.
                    Types of parameters 'addGlobalEventProcessor' and 'addGlobalEventProcessor' are incompatible.
                      Types of parameters 'callback' and 'callback' are incompatible.
                        Type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/eventprocessor").EventProcessor' is not assignable to type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/eventprocessor").EventProcessor'.
                          Types of parameters 'hint' and 'hint' are incompatible.
                            Type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/event").EventHint' is not assignable to type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/event").EventHint'.
                              Types of property 'captureContext' are incompatible.
                                Type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/scope").CaptureContext | undefined' is not assignable to type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/scope").CaptureContext | undefined'.
                                  Type 'Scope' is not assignable to type 'CaptureContext | undefined'.
                                    Type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/scope").Scope' is not assignable to type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/scope").Scope'.
                                      Types of property 'update' are incompatible.
                                        Type '(captureContext?: import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/scope").CaptureContext | undefined) => import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/scope").Scope' is not assignable to type '(captureContext?: import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/scope").CaptureContext | undefined) => import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/scope").Scope'.
                                          Types of parameters 'captureContext' and 'captureContext' are incompatible.
                                            Type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/scope").CaptureContext | undefined' is not assignable to type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/scope").CaptureContext | undefined'.
                                              Type 'Scope' is not assignable to type 'CaptureContext | undefined'.
                                                Property 'setSDKProcessingMetadata' is missing in type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/electron/node_modules/@sentry/types/types/scope").Scope' but required in type 'import("d:/dev/projects/glint/angular/node_modules/@sentry/types/types/scope").Scope'.ts(2345)
@MikeJerred
Copy link
Author

Workaround is to specify these versions in package.json:

"@sentry/angular": "7.16.0",
"@sentry/electron": "4.1.0",

@timfish
Copy link
Collaborator

timfish commented Nov 3, 2022

Yes, you need to use versions that match the ones used by the Electron SDK.

I need to find a way to give a more useful error message in this case 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants