Script problem after update #325
-
i just updated my magento installation from 2.4.6 to 2.4.7-p2 and Breeze & breeze evolution to 2.17.16 & 2.2.0, i have found that some scripts no longer work:
this script (in extend.js file in child theme) now returns the error "$.alert is not a function", it worked fine in the old version (Breeze 2.9.1 / evolution 2.1.5 ), didn't find any clues in the changelog |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I forgot to mention this change, sorry. It's caused by You need to explicitly require dependency now (like in Luma). Here is how it should work: $(document).on('breeze:load', function () {
require(['Magento_Ui/js/modal/alert'], function (alert) {
alert({
title: $t('Title'),
content: $t('Content')
});
});
}); p.s. I updated the code example to match your use-case. |
Beta Was this translation helpful? Give feedback.
I forgot to mention this change, sorry. It's caused by
define|require
function refactoring.You need to explicitly require dependency now (like in Luma). Here is how it should work:
p.s. I updated the code example to match your use-case.