-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Invalid shims in Magento core break core-bundle.js
at runtime
#6
Comments
Thanks for the report Victor. It looks like there are a few things going on here. Issue with
|
Thank you for such a detailed reply and sorry for not clear situation with "requirejs-config.js" - this is renamed requirejs-bundle-config.js in my project We have shim for not only jquery/jquery-storageapi" but for "mage/common" too. I think you've already seen this in baller log. And as you understand the wrong shim can be in requirejs-config.js from any other third-party Magento extensions and we can't override requirejs-config.js for separate extension in our child theme. So maybe fix #3 is the best for such situations. There are 2 questions: |
I think it's possible for us to auto-fix in certain situations, but I'm not quite convinced that would be the right approach. Because it's not a supported way to use the RequireJS API, we'd be building in a hack that could have unintended side-effects. Need to think on this a bit more.
Backports will happen for all currently supported versions of Magento. I believe there will be composer patches (or something similar) released in the interim for those that can't wait for a new release. |
Baler, gives me two additional warnings about shims besides the jquery/jquery-storageapi shim.
They seem to stem from the same core file as the issue above.
I'm running against 2.2.9, but I can see the same shims in 2.3.develop too. |
Hi @friendscottn! Thanks for reporting. Those 2 shims are also eliminated in my fix. Next week it will be merged to mainline. I’ll keep you updated. Thanks! |
Hey that's great @adifucan. Thank you! |
core-bundle.js
at runtime
Added a doc on this that we now surface in the CLI: https://github.com/DrewML/baler/blob/master/docs/INVALID_SHIM.md ┌─[andrewlevine] [~/sites/baler]
└─▪ baler
Collecting data about themes and modules from the store
Data collection completed in 145ms
Found 1 eligible theme to optimize
- Magento/luma
Starting to bundle core-bundle for Magento/luma with 95 dependencies
One or more invalid shim configurations were found while bundling Magento/luma. See https://github.com/DrewML/baler/blob/master/docs/INVALID_SHIM.md
- mage/common
- moment
- jquery/jquery-storageapi |
@adifucan can you crosslink here PR/issue on Magento side where the shim are goong to be fixed? |
@tmotyl it's merged today into mainline within this commit: magento/magento2@db43c11 |
@adifucan Will the PR make it into the 2.3.3 release? |
@Vinai unfortunately not. but it will be available in 2.3.4 |
@adifucan Thank you for the reply, even though that’s sad news. |
I created a patch gist for the |
That is a list of loaded JS files in waterfall order.
Pay attention to the order of files core-bundle.js and jquery.cookie.js
core-bundle.js includes jquery-storageapi.js at the same time, storageapi is depended from
'jquery/jquery-storageapi': {'deps': ['jquery/jquery.cookie']}
As you see from Image jquery.cookie.js is loaded later bundle. In result, I have some Js error because of undefined Jquery methods.
Looks like all files included in the bundle should be checked for dependencies, and I afraid they should be sorted in the bundle in the correct order.
The text was updated successfully, but these errors were encountered: