In my node_modules I added the dependency of bootstrap that allows me to get dropdown.js. But when I am going on the page where I am using a dropdown, when I click on the dropdown button it doesn't work on development mode and it returns the following error:
dropdown.js:186 Uncaught TypeError: u is not a constructor
at c.t.show (dropdown.js:186)
at c.t.toggle (dropdown.js:137)
at HTMLButtonElement.<anonymous> (dropdown.js:375)
at Function.each (jquery.js:367)
at jQuery.fn.init.each (jquery.js:202)
at jQuery.fn.init.c._jQueryInterface [as dropdown] (dropdown.js:362)
at HTMLButtonElement.<anonymous> (dropdown.js:528)
at HTMLDocument.dispatch (jquery.js:5237)
at HTMLDocument.elemData.handle (jquery.js:5044)
The concerned line in this dropdown.js file is the following one:
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
"Popper is not a constructor."
I tried this:
this._popper = Popper.createElement(referenceElement, this._menu, this._getPopperConfig());
But it is still not working.
What is strange is that I get this error only in development mode, not in production.
Here is the link to the entire file dropdown.js but I am not sure it will be helpful: