-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
jquery.cookie dependency leads to JS issues with KO dependencies #35913
Comments
Hi @sidolov. Thank you for your report.
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hello @jissereitsma
|
I am also experiencing this. For example, if call
Then:
will not work. |
Hello @khoimm92 |
@xmav Sorry for the delay. As mentioned on twitter, I actually fixed the issue for myself earlier. But I tested out things out, and indeed the fix is good! Many thanks! Also thanks @sidolov @vovayatsyuk for helping along with this. |
Working fine for me! |
Is this patch released? I am facing this issue on ver. 2.4.5-p1 also. |
That patch fixed my issue on M2.4.5-p2 |
Preconditions and environment
Steps to reproduce
From Twitter:
https://twitter.com/jissereitsma/status/1557372818257485834
I'm not getting this entirely yet, but a custom #magento 2.4.5 install had a theme with a global Require dep for "jquery/jquery.cookie": This suddenly caused all of the other JS (like KO) to fail silently.
https://twitter.com/jissereitsma/status/1557391198863638530
My theme had a requirejs-config.js with a global "dep" for "jquery/jquery.cookie". Simply because of that, an add-to-cart was not weird: The AJAX call towards the addtocart URL worked fine, with a valid reply. But then the customerData AJAX call was never made ... :o I'm baffled
https://twitter.com/vovayatsyuk/status/1557399058435686400
Looks like Magento can't load the same dependency using different names. You load 'js-cookie/cookie-wrapper' with 'jquery/jquery.cookie' alias, while magento load the same file using 'js-cookie/cookie-wrapper' string.
Can be fixed at https://github.com/magento/magento2/blob/2.4-develop/lib/web/js-storage/js.storage.js#L17
@jissereitsma , @vovayatsyuk please, add additional information if I missed something
Expected result
It's possible to use aliases for jquery/jquery.cookie
Actual result
Issue caused all of the other JS (like KO) to fail silently.
Additional information
No response
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: