sentry-capacitor icon indicating copy to clipboard operation
sentry-capacitor copied to clipboard

TypeError: Class constructor Scope cannot be invoked without 'new'

Open AliMejbar opened this issue 3 years ago • 2 comments

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which SDK and version? "@sentry/capacitor": "^0.7.1",

Just in case it's relevant , which I think is not . Here is my stack:

// ...
"@capacitor/cli": "^3.6.0",
"next": "^12.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "4.7.4"
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
// ...

Steps to Reproduce

nothing special , basic configuration like the one in the tutorial :

import * as Sentry from '@sentry/capacitor'

const sentryConfig = {
  dsn: process.env['NEXT_PUBLIC_SENTRY_DSN'],
  release: process.env['NEXT_PUBLIC_SENTRY_PROJECT_NAME'] + '@' + version,
  dist: process.env['NEXT_PUBLIC_SENTRY_DIST'],
}

Sentry.init( sentryConfig )

Expected Result

Worked normally until "0.7.1" of yesterday, code wasn't changed and was working perfectly.

Actual Result

TypeError: Class constructor Scope cannot be invoked without 'new'
    at new CapacitorScope (/Users/mohamedalimejbar/Desktop/Tabibe/App/node_modules/@sentry/capacitor/dist/build/scope.js:12:42)
    at Object.init (/Users/mohamedalimejbar/Desktop/Tabibe/App/node_modules/@sentry/capacitor/dist/build/sdk.js:30:49)
    at eval (webpack-internal:///./pages/_app.tsx:68:49)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  page: '/'
}
error - TypeError: Class constructor Scope cannot be invoked without 'new'
    at new CapacitorScope (/Users/mohamedalimejbar/Desktop/Tabibe/App/node_modules/@sentry/capacitor/dist/build/scope.js:12:42)
    at Object.init (/Users/mohamedalimejbar/Desktop/Tabibe/App/node_modules/@sentry/capacitor/dist/build/sdk.js:30:49)
    at eval (webpack-internal:///./pages/_app.tsx:68:49)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  page: '/'
}

Capture d'écran 20 07 2022 à 12 17 54 p m

AliMejbar avatar Jul 20 '22 11:07 AliMejbar

Was it working on version 0.7.1.? if so, are you using @sentry/react ? Version 0.7.1 only contained a version bump of the main Javascript SDK from 7.1.01to 7.6.0, so perhaps you are using an old dependency with @sentry/capacitor?

lucas-zimerman avatar Jul 27 '22 00:07 lucas-zimerman

Was it working on version 0.7.1.? if so, are you using @sentry/react ?

  • No it was working on 0.6.x , not in 0.7.1 , no i'm not using @sentry/react , only @sentry/capacitor

Version 0.7.1 only contained a version bump of the main Javascript SDK from 7.1.01to 7.6.0, so perhaps you are using an old dependency with @sentry/capacitor?

  • No , all my dependencies are at latest.

AliMejbar avatar Jul 27 '22 12:07 AliMejbar

@AliMejbar - Did you solve this issue? I'm getting the same error on v0.11.3

denny64 avatar May 10 '23 04:05 denny64

@AliMejbar - Did you solve this issue? I'm getting the same error on v0.11.3

No I ditched sentry in that app.

AliMejbar avatar May 10 '23 10:05 AliMejbar

Also experiencing this issue when using v0.11.3

Do not experience this issue with v0.6.1

nicholas-hooley avatar May 12 '23 09:05 nicholas-hooley

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Jun 03 '23 00:06 github-actions[bot]

@nicholas-hooley sorry for the late response but what is your target on the compilerOptions from your typescript config?

lucas-zimerman avatar Oct 13 '23 02:10 lucas-zimerman

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Dec 16 '23 00:12 github-actions[bot]