question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError e is not a function (promisebuffer taskProducer is not a function)

See original GitHub issue

Package + Version

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:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jayalacommented, Aug 28, 2021

0.4.0 fixed it for me. Thank you guys, you rock!

1reaction
Cyralcommented, Aug 26, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught (in promise) TypeError: e is not a function
Trying to create a regression model in ml5.js that takes a 2d array of posenet landmark coordinates as inputs and another of the...
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >
Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError - Some selector is not a function - jQuery is not a function - owlCarousel...
Read more >
How to fix "Uncaught TypeError: x is not a function" in JavaScript
JS Casts 01 - How to fix "Uncaught TypeError : x is not a function " in JavaScript.Visit https://javascriptcasts.com/episodes/01 for a summary ...
Read more >
[js] TypeError: e.split is not a function · Issue #829 - GitHub
Issue Id: 837ddb7d-c443-d535-b2a5-9c6d8325db60. Versions - 0.10.1-release - 7cc0c60. Stack TypeError: e.split is not a function
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found