I just need to add bootstrap 4, so I can use it in my template.
In Magento 1 I could just add all the scripts to the head and then I could use bootstrap.
So I tried it:
app\design\frontend\company\base\Magento_Theme\layout\default_head_blocks.xml
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <!-- Latest compiled and minified CSS --> <link src_type="url" rel="stylesheet" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" /> <!-- Latest compiled JavaScript --> <script src_type="url" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> </head> </page>
But I get Uncaught Error: Mismatched anonymous define() module in the console.
I also tried it like seen here. I get "Uncaught Error: Script error for: bootstrap"
Solved! Go to Solution.
The problem is solved now, see the post on magento stackexchange.