Exciting news - Bootstrap 4 Beta
has been released! However, Tether has been replaced with Popper.js
for tooltip functionality (among other features). This change has triggered a new error in the console, prompting me to switch to Popper.js
:
Bootstrap dropdown require Popper.js
Updating my webpack.config.js
(you can view the full config here) seemed to resolve the issue (simply replacing Tether with Popper):
plugins: [
new ProvidePlugin({
'Promise': 'bluebird',
'$': 'jquery',
'jQuery': 'jquery',
'window.jQuery': 'jquery',
'window.$': 'jquery',
Popper: 'popper.js'
}),
I also added import 'bootstrap'
to my main.ts
file.
However, a new problem has arisen (not present with Tether) - a console error now states:
Uncaught TypeError: Popper is not a constructor
Upon debugging in Chrome, I noticed that Popper
is loaded as an Object (resolving the Bootstrap complaint) as shown in the screenshot below. https://i.sstatic.net/pyLZi.jpg
In conclusion, I utilize Bootstrap tooltip within a basic custom element constructed with Aurelia
and TypeScript
(previously functional with Bootstrap alpha 6 and Tether).
import {inject, customAttribute} from 'aurelia-framework';
import * as $ from 'jquery';
@customAttribute('bootstrap-tooltip')
@inject(Element)
export class BootstrapTooltip {
element: HTMLElement;
constructor(element: HTMLElement) {
this.element = element;
}
bind() {
$(this.element).tooltip();
}
unbind() {
$(this.element).tooltip('dispose');
}
}
It seems that my Popper
import may have been incorrect. My question is, what is the recommended method to properly import Popper
using Webpack 3.x
?