I'm using an outside JS library built with Webpack and Babel. The library is self-contained and only adds a single global variable.
When this library is loaded onto a product page, the hover-over and select functionality of Magento's configurable swatches breaks.
On hover, colors/sizes still dynamically show stock. But when hovering or clicking the swatches, the following error is logged:
(Chrome) Uncaught TypeError: Cannot read property 'apply' of undefined prototype.js:936 (Firefox) TypeError: value[method] is undefined prototype.js:936:7
This traces to
skin/frontend/rwd/default/js/configurableswatches/swatches-product.js:676:40 which is the following:
el.select('span span').invoke('update', Translator.translate(this._E.cartBtn.txt[index]));
When I try to then add the product to cart, I get messages saying "Please select a size", etc.
Is there a known problem with Prototype and Babel or Webpack that would cause this?