sentry-capacitor
sentry-capacitor copied to clipboard
TypeError: Class constructor Scope cannot be invoked without 'new'
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: '/'
}

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?
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 - Did you solve this issue? I'm getting the same error on v0.11.3
@AliMejbar - Did you solve this issue? I'm getting the same error on v0.11.3
No I ditched sentry in that app.
Also experiencing this issue when using v0.11.3
Do not experience this issue with v0.6.1
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 🥀
@nicholas-hooley sorry for the late response but what is your target on the compilerOptions from your typescript config?
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 🥀