1

I try to optimize the bundles of magento with the information from devdocs . I try to do it on Magento 2.2.6 but the main issue is that after generating the bundles I get an error from the customer-data regarding

TypeError: $.cookieStorage is undefined; can't access its "setConf" property

Did anyone had this error?

EDIT: After some more investigation looks like this error comes from jquery/jquery.storageapi.min strange think is that only when trying to do it as suggested on Magento Devdocs https://devdocs.magento.com/guides/v2.3/performance-best-practices/advanced-js-bundling.html

  • check if merge js is on then it suggest to make enable only one at a time eigher bundling js or js merge.it would be create problem if both are enable at the same time. – Zaheerabbas Dec 4 '18 at 6:34
  • @Zaheerabbas with js merge disabled is the same thing – Vlad Patru Dec 4 '18 at 7:46
2

Found the issue, main problem was that the guide in the devdocs has some mistakes in it. To fix this I had to find in my build.js "jquery/jquery-migrate": ["jquery" in the shim section and replace it with "jquery/jquery-migrate": ["jquery", "jquery/jquery.cookie"] so just adding jquery.cookie to the deps fixed it

| improve this answer | |
  • hi vlad, did you succeed to do the buding on 2.2.6? because i saw that the documentation is only for 2.3 version – Alin Lupoiu Jan 31 '19 at 10:24
  • i tried to do the bunding on the same version but i have a lot of err – Alin Lupoiu Jan 31 '19 at 10:24
  • @AlinLupoiu I used the same documentation but I had to change a bit the settings in the JS. like I said in my answer above. What errors you get? – Vlad Patru Jan 31 '19 at 15:02
  • I get error after adding code from step 4 of part 2 of the guide. The code that should configure requirejs to use bundles. After i rerun the r.js -o command i get Error: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at maybeCallback (fs.js:128:9) – Asadov Kamran May 17 '19 at 19:07
  • @Vlad Patru, hi could you please share your skype so I can get your help in advanced JS bundling? The only issue is that all my advanced JS bundles load on the catalog page which should only load default and catalog.js bundles. – CodeForGood Apr 24 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.