Magento 2 RequireJS – Mismatched Anonymous Define()

magento2requirejs

I've added a lot of RequireJS code, but know suddenly it does not work anymore. I get an error 'Mismatched anonymous define()' for code that's added from phtml files. This is the code where the error is thrown:

the code where the error is thrown

This is the error is thrown:

error

How can this suddenly not work anymore?

Update

I think there's something completely off with my JS loading. I get different JS errors each time I load the page:

enter image description hereenter image description hereenter image description here

Update 2

Thanks to Siarhey Uchukhlebau I found the answer. The real error was thrown by an external script (Tawk.to, a chat client). This error caused all kind of weird errors. I will investigate this problem further to check if we can isolated these kind of script to prevent them from messing with our main script.

Best Answer

As I can see in the debug error comes from the online chat script:

https://embed.tawk.to/58f61af6f7bbaa72709c6ddd/default

debug window

First, try to remove it from your store, clean cache and make sure that error has gone, then I'll recommend you contact their support team.