TypeError e is not a function (promisebuffer taskProducer is not a function)
See original GitHub issue- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
- @sentry/capacitor: 0.3.0
- @sentry/react: 6.11.0
- @sentry/tracing: 6.11.0
- @sentry/browser: 6.11.0
- @sentry/core: 6.11.0
- @sentry/hub: 6.11.0
- @sentry/integrations: 6.11.0
- @sentry/types: 6.11.0
- @sentry/utils: 6.11.0
- @capacitor/android: 3.0.1
- @capacitor/ios: 3.0.1
- react: 17.0.1
Version:
6.11.0
Description
Thousands of events about TypeError: e is not a function
or TypeError e is not a function. (In 'e()', 'e' is an instance of Promise)
appeared in sentry
https://sentry.io/share/issue/f15a111c32194a4b8849eab5d57117ca/
https://sentry.io/share/issue/063ea9b0aed04eb4849da3e42354197a/
e
is taskProducer
in promisebuffer.ts
https://github.com/getsentry/sentry-javascript/blob/release/6.11.1/packages/utils/src/promisebuffer.ts#L34
It seems that all of it happens on Android.
But another event Maximum call stack size exceeded
happen both android and ios, and those event have a lot of TypeError: e is not a function. (In'e()','e' is an instance of Promise)
in the breadcrumbs
https://sentry.io/share/issue/b98ae7d792be4fd0a6693fa9c83f94df/
This is my code about initial sentry, not sure if I use it incorrectly
import { Capacitor } from '@capacitor/core'
import { Integrations } from '@sentry/tracing'
import * as NativeSentry from '@sentry/capacitor'
import * as ReactSentry from '@sentry/react'
import config from '@/config'
import history from '@/libs/history'
const sentryConfig = {
dsn: '...dsn...',
release: `customer-app@${config.version}`,
dist: config.commit,
environment: config.env,
integrations: [
new Integrations.BrowserTracing({
routingInstrumentation: ReactSentry.reactRouterV5Instrumentation(history),
}),
],
tracesSampleRate: 0.0,
_metadata: {
sdk: {
name: ReactSentry.SDK_NAME,
version: ReactSentry.SDK_VERSION,
},
},
}
const platform = Capacitor.getPlatform()
if (platform === 'web') {
ReactSentry.init(sentryConfig)
} else {
NativeSentry.init(sentryConfig, ReactSentry.init)
}
After some try, I finally found that when use the Sentry.init() import from @sentry/capacitor
will receive a lot of e is not a function
events.
If only use Sentry.init() from @sentry/react
, will not receive it.
But I’m not sure if it’s because the error didn’t happen, or because there was no native sentry init, so the event was not received from native error or crash.
I did not encounter this problem when I was running the app. These problems occurred when the user used the app, so it was difficult to handle.
import { Integrations } from '@sentry/tracing'
import * as ReactSentry from '@sentry/react'
import config from '@/config'
import history from '@/libs/history'
const sentryConfig = {
dsn: '...dsn...',
release: `customer-app@${config.version}`,
dist: config.commit,
environment: config.env,
integrations: [
new Integrations.BrowserTracing({
routingInstrumentation: ReactSentry.reactRouterV5Instrumentation(history),
}),
],
tracesSampleRate: 0.0,
_metadata: {
sdk: {
name: ReactSentry.SDK_NAME,
version: ReactSentry.SDK_VERSION,
},
},
}
ReactSentry.init(sentryConfig)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
0.4.0
fixed it for me. Thank you guys, you rock!Looks like this is waiting on https://github.com/getsentry/publish/issues/502 to be accepted, which would include the fix in getsentry/sentry-capacitor#72