When plotly.js is loaded in Chrome by the native ES6 import, the loading crashes with Cannot read property 'document' of undefined at line 18178, i.e. at var d3_document = this.document;
The problem is that the bundler assumes that when a function is executed without any this, the this will automatically be set to window. This is not the case with ES6 modules, where this will be undefined.
I fixed it by changing line 27724 from }(); to }.apply(self); but this is just a hack :)
When
plotly.jsis loaded in Chrome by the native ES6import, the loading crashes withCannot read property 'document' of undefinedat line18178, i.e. atvar d3_document = this.document;The problem is that the bundler assumes that when a function is executed without any
this, thethiswill automatically be set towindow. This is not the case with ES6 modules, wherethiswill be undefined.I fixed it by changing line
27724from}();to}.apply(self);but this is just a hack :)