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

Fn is not a function #3328

Closed
netdown opened this issue Nov 24, 2021 · 3 comments · Fixed by #3329
Closed

Fn is not a function #3328

netdown opened this issue Nov 24, 2021 · 3 comments · Fixed by #3329
Labels

Comments

@netdown
Copy link
Contributor

netdown commented Nov 24, 2021

Hi,

I'm not sure about the reasons, but in my setup, the latest release (2.2.3) does not work. The problem is that the steps array in _runUpload2 function has empty values and these empty values are invoked as functions.

This is caused by line
const steps = [..._classPrivateFieldLooseBase(this, _preProcessors)[_preProcessors], ..._classPrivateFieldLooseBase(this, _uploaders)[_uploaders], ..._classPrivateFieldLooseBase(this, _postProcessors)[_postProcessors]];
being changed to
const steps = [...Array.from(_classPrivateFieldLooseBase(this, _preProcessors)[_preProcessors]), ...Array.from(_classPrivateFieldLooseBase(this, _uploaders)[_uploaders]), ...Array.from(_classPrivateFieldLooseBase(this, _postProcessors)[_postProcessors])];

The first would result [fn()], the seconds results [Set(0), Set(1), Set(0)].

@Murderlon
Copy link
Member

Murderlon commented Nov 24, 2021

Related to: #3297

@aduh95 should we simply revert this?

@jlowcs
Copy link

jlowcs commented Dec 9, 2021

That revert might actually have broken our own app. We are now seeing d is not a function in our babel/webpack-built app.

image

The error happens in loggers.js, but that could be triggered by an issue with the spread operator.

@jlowcs
Copy link

jlowcs commented Dec 9, 2021

I'm not sure I understand the issue you were experiencing @netdown

Would rewriting the code this way work better while still allowing ES5 support?

    const steps = [
      ...this.#preProcessors.values(),
      ...this.#uploaders.values(),
      ...this.#postProcessors.values(),
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants