What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi everyone, I have run into the console error: _Cannot read property ‘call’ of undefined_ which le

UTP9VMTAT
UTP9VMTAT Posts: 4 🧑🏻‍🚀 - Cadet

Hi everyone,
I have run into the console error:
Cannot read property ‘call’ of undefined
which leads to some of our frontend molecules not being loaded correctly. When I debug it always breaks at the line:
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
I think it might be due to a webpack configuration issue which leads to the chunks being imported incorrectly or in the wrong order.
Can anyone help me with this issue?
Thanks in advance 🙂

Comments

  • Aleksander Kovalenko
    Aleksander Kovalenko Sprykee Posts: 45 🧑🏻‍🚀 - Cadet

    Hi Corrina! Can you please describe how you created this component?

  • UTP9VMTAT
    UTP9VMTAT Posts: 4 🧑🏻‍🚀 - Cadet
    edited February 2020

    Hi sure 🙂
    The folder structure is:
    src/Pyz/Yves/ShopUi/Theme/default/components/molecules/carton-finder-product-card
    The ts file contains only a readyCallback function.
    I also get a variation of the console error:
    [yves_default@error] application error -> Error: form-data-injector failed to be defined
    Loading chunk 98 failed.
    on another page

  • Aleksander Kovalenko
    Aleksander Kovalenko Sprykee Posts: 45 🧑🏻‍🚀 - Cadet

    Looks ok. And you don’t have any issues with building?

  • UTP9VMTAT
    UTP9VMTAT Posts: 4 🧑🏻‍🚀 - Cadet

    Nop no issues with building

  • giovanni.piemontese
    giovanni.piemontese Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    edited February 2020

    We have the same problem, but only on our integration and staging system (we dont have any production now).
    On dev (docker) works.

    The first idea was that we had some TS that override the construct method, instead the init and readCallback.. After refactoring the problem is still there...

    The unique difference between dev and staging is that staging is very very fast (ttb) and we use there the composer dump-autoload -a to speed up the class resolver from composer...

    When I run just the composer dump-autoload (without classmap authoritative) then the page is a little slower and this problem about TS component not found/loaded does not appear more...

    UPDATE:
    It is enough to reload hard the page in browser and then works...

  • UTP9VMTAT
    UTP9VMTAT Posts: 4 🧑🏻‍🚀 - Cadet

    Hi Giovanni, thank you very much for your answer!

    Yea we also noticed on hard reload the bug was gone and that is also what makes the bug so hard to reproduce. Sadly, refreshing the page is not an option for the customer when the components on the page aren’t loaded properly 😞

    I have emailed a Spryker frontend dev and will let you know if he has another option for fixing the bug other than refreshing the page 🙂

  • giovanni.piemontese
    giovanni.piemontese Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    yes of course... the reload is not the solutions... just as info for spryker dev that maybe can understand what is the problem..