In my environment implemented Bootstrap 4 in Magento 2.2.5 at first glance it seemed to work. all of my js and css worked perfectly without any error's. But after sometime, I got error: Uncaught Error: Mismatched anonymous define() module: function (exports, $) { 'use strict'; Line 141 Require.js. I followed the instructions given by Manoj Deswal and Vivek
Magento 2 : Add Bootstrap 4 in theme
It seems that the css as in grid system and so on still works, its just that the js/jquery is giving me troubles.
It worked as I said be for, but what ever I try, the error does not disappear.
Does anyone has a suggestion?
Full error Message : https://pastebin.com/103izvSJ Disclaimer, it is one heck of a error!
I have found out it is just the bootstrap.bundle.js is giving me this error. the file as a hole is giving me: ' Mismatched anonymous define() module: function (exports, $) { 'use strict';' i have linked it in my Default_head_block.xml, and i have linked it in the Requiredjs-config.js file as followed, (correct me if im wrong):
paths: {
'jquery/ui': 'jquery/jquery-ui',
'bootstrap':'Magento_Theme/js/bootstrap.bundle'
},
shim: {
'bootstrap': {
'deps': ['jquery']
}
},
and i added
<script type="text/javascript">
require(['bootstrap']);
</script>
In the header.phtml file as instructed. but it just won't stop giving me an error.
i even try'ed to link it by external source, but it gives me the same error as befor, or something like net::ERR 404, Not found.