On Magento 2.2.6 I restored from an earlier database. After doing that I flushed the cache, reindexed the site,and deployed static content. I now get require.js errors on every page. On my category page-

knockout.js:3012 Uncaught TypeError: Unable to process binding 
"visible: function(){return isVisible() }"
Message: Cannot read property 'hasMessages' of undefined
at UiClass.isVisible (messages.js:51)
at visible (eval at createBindingsStringEvaluator (knockout.js:2624), <anonymous>:3:67)
at update (knockout.js:4558)
at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
at evaluateImmediate (knockout.js:1737)
at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
at knockout.js:3002
at Object.arrayForEach (knockout.js:151)
at applyBindingsToNodeInternal (knockout.js:2974)
at applyBindingsToNodeAndDescendantsInternal (knockout.js:2854)

On a different category page-

Uncaught Error: Mismatched anonymous define() module: function(){return t(e)}
at makeError (require.js:166)
at intakeDefines (require.js:1221)
at require.js:1408

The Mismatched anonymous define is also on the item page. I didn't change any code so I am not sure what to here. How can I clear these errors?

1 Answer 1

  • Delete all files and folder in

    • magento2-root/pub/static/*
    • magento2-root/var/cache/*
    • magento2-root/var/page_cache/*
    • magento2-root/var/view_preprocessed/*
  • Redeploy Magento php bin/magento setup:static-content:deploy

  • Set proper permissions i.e 777 to all above directories.

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.