Description
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 :)