I ran into the same problem if I use popper.js from a CDN network like cdnjs .
If you observe the source code for Bootstrap 4 examples, such as Navbar , you can see popper.min.js loading from:
<script src="https://getbootstrap.com/docs/4.1/assets/js/vendor/popper.min.js"></script>
I included this in my project and the error went away. You can download the source code from
https://getbootstrap.com/docs/4.1/assets/js/vendor/popper.min.js
and include in your project as a local file, and it should work.
source share