Uncaught TypeError: Popper is not a constructor
See original GitHub issueI’m seeing the following error message when using Popper 1.9.8:
Uncaught TypeError: Popper is not a constructor
I’m trying to import Popper as a module using Webpack (Laravel Mix) and tried several combinations:
import Popper from 'popper.js';
require('popper.js/dist/popper.js' );
require('popper.js/dist/esm/popper.js' );
require('popper.js/dist/umd/popper.js' );
window.Popper = require('popper.js/dist/esm/popper.js' );
How can I import Popper, it doesn’t matter if I use import * from or require().
Issue Analytics
- State:
- Created 6 years ago
- Comments:33 (13 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Popper is not a constructor
So, I have tried to npm install popper in my directory working file but,it's not work at all. Did I miss something? javascript...
Read more >Uncaught TypeError: Popper is not a constructor #287 - GitHub
I'm trying to import Popper as a module using Webpack (Laravel Mix) and tried several combinations: import Popper from 'popper.js'; require(' ...
Read more >bootstrap min js 6 uncaught typeerror u is not a constructor
When using Bootstrap 4 and above you need to reference the following things:. Bootstrap css ; jQuery ; Popper.js ; Bootstrap.js ; The...
Read more >Popper.js updated to version 2.0.6 | Drupal.org
Uncaught TypeError : Popper is not a constructor; If Popper 1.x is installed but code is written for Popper 2.x: Uncaught TypeError: Popper....
Read more >Bootstrap 4 Beta Importing Popper.Js With Webpack 3.X ...
Uncaught TypeError : Popper is not a constructor. If I try to I just ran into the same issue and the solution is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I got into an event stranger situation:
My main file (stripped down):
This leads to an error:
Uncaught Error: Bootstrap dropdown require Popper.js.Adding the umd bundle as an alias in Mix’s autoload makes it work:
Now, I’m actually happy that it works, but I don’t fully understand why it wont if I do not add it to webpack aliases (via
mix.autoload). I’m not asking you to answer my question, I’m just leaving this here for the records.I have the same issue as @tillkruss, and I’m using Laravel Mix as well.
I have tried every combination of import or require, set
window.PoppertoPopperorPopper.default, and so on. I also added autoloading options to Laravel Mix config file:However, the only way I got this working was by manually editing Bootstrap’s
dropdown.jsto usenew Popper.default(...)instead of justnew Popper(...).Anybody knows its ways around this? What am I doing wrong?