From 265a72038deaae9968557237dd8d1e4f89c4beab Mon Sep 17 00:00:00 2001 From: boo-code Date: Sat, 5 Sep 2026 13:01:03 +0200 Subject: [PATCH] Expose Tether's default export, not the module namespace tether 2.0.0 declares module: dist/js/tether.esm.js, which ends with 'export default Tether', and webpack resolves it through that field. So 'expose-loader?exposes=Tether' put the namespace object on window.Tether: new Tether(...) threw "Tether is not a constructor" and Bootstrap 4 alpha's tooltips and popovers - including the password strength hint on the registration form - stayed broken. expose-loader splits an entry on '|' into globalName and moduleLocalName, so 'Tether|default' assigns the export. Built bundles, before and after: before void 0 === i.Tether && (i.Tether = r) // r is the namespace after var o = r.default; void 0 === i.Tether && (i.Tether = o) // o is the class Reported on PrestaShop/PrestaShop#39088. --- _dev/js/theme.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_dev/js/theme.js b/_dev/js/theme.js index 64ca3603..da70ce27 100644 --- a/_dev/js/theme.js +++ b/_dev/js/theme.js @@ -23,7 +23,11 @@ * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ /* eslint-disable */ -import 'expose-loader?exposes=Tether!tether'; +// tether 2.x ships an ES module whose default export is the class, and webpack resolves it through +// the package's `module` field, so exposing the import itself puts the namespace object on +// window.Tether - `new Tether(...)` then throws "Tether is not a constructor" and Bootstrap's +// tooltips and popovers stay broken. `|default` exposes the export instead of the namespace. +import 'expose-loader?exposes=Tether|default!tether'; import 'bootstrap/dist/js/bootstrap.min'; import 'flexibility'; import 'bootstrap-touchspin';