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

TypeError error e is not a function and TypeError error Function expected #58

Open
mathieux51 opened this issue Nov 13, 2019 · 0 comments

Comments

@mathieux51
Copy link

mathieux51 commented Nov 13, 2019

Hi @rauchg and @leo,

I recently added async-retry to the project I'm working on because I was getting a lot of ChunkLoadError Loading chunk 6 failed in Sentry. This is how I currently use it:

import loadable from '@loadable/component'
import retry from 'async-retry'

const Dashboard = loadable(() =>
  retry(() => import(/* webpackChunkName: "Dashboard" */ 'containers/pages/Dashboard'), {
    factor: 1,
    maxTimeout: 10000,
  })
)

I'm now getting a new error on Sentry from async-retry package. I'm not sure to understand it:

function runAttempt(num) {
  32       var val;
  33
  34       try {
  35         val = fn(bail, num);
  36       } catch (err) {
  37         onError(err, num);
  38         return;
  39       }
  40
  41       Promise.resolve(val)
  42         .then(resolve)
  43         .catch(function catchIt(err) {
  44           onError(err, num);
  45         });
  46     }

According to Sentry the problem is on line 35 of this function. I get 3 different error messages:

  • TypeError error e is not a function
  • TypeError error Function expected
  • TypeError e is not a function. (In 'e(c,t)', 'e' is an instance of Promise)

Am I doing something wrong or is it a bug?
I would be happy to help either way.

@mathieux51 mathieux51 changed the title TypeError error e is not a function and TypeError error Function expected TypeError error e is not a function and TypeError error Function expected Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant