1

I have updated the Magento to 2.4.7 recently and updated it to the staging server. I am getting the error that cookieMessagesObservable is not defined in the console and due to this Minicart is not accessible to me and several js are also not loading due to it.

Check the below image for the reference:- Console Error

5
  • cookieMessagesObservable is not defined in core Magento codebase, you will have to look into your code base for it and post the file(s) having reference to this variable so people can help you debug it. Commented May 16 at 7:37
  • I am having same issue , can you find any solution @Aman ? Commented May 17 at 6:11
  • I @aman Can you find any solution ? Commented Jun 3 at 9:30
  • I have tried installing Magento to the latest version using Composer install. After that check, the message.js file is overrided in my custom module or app/design and changed on the overridden file as per the vendor message.js file. By doing the changes it helps me solve the issue. Commented Jun 4 at 10:06
  • Do we have any other possible solution in this? message.js is generated again after deployment in the static/*version*/frontend/*ThemeVendor*/*ThemeName*/Magento_Theme/js/view/messages.js But still error was there in the console.
    – Abby
    Commented Jul 5 at 9:06

1 Answer 1

0

You most likely need to redeploy static content. Either delete all everything in the folders pub/static/frontend and pub/static/adminhtml and run:

php bin/magento setup:static-content:deploy

This might take a few minutes, after make sure your browser isn't caching any of the old files, and refresh this should resolve the problem.

You are looking for a file to update called messages.js it should be in

static/*version*/frontend/*ThemeVendor*/*ThemeName*/Magento_Theme/js/view/messages.js

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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