David-Desmaisons / vue-plotly

📈 vue wrapper for plotly.js
https://david-desmaisons.github.io/vue-plotly/
MIT License
255 stars 74 forks source link

Uncaught TypeError: Cannot read property 'document' of undefined #41

Open wxfred opened 2 years ago

wxfred commented 2 years ago

I'm using electron + vue-cli-plugin-electron-builder, in dev mode, no error occur, while the final production bundle appear white screen with an error message in console. I checked the source code of vue-plotly, found that it is still using plotly.js while official recommend is plotly.js-dist. After a little bit source code changes switching to the new package, the error disappeared. Please update the dependence from plotly.js to plotly.js-dist.

DnOberon commented 2 years ago

@wxfred how did you make these changes? I'm running into the same exact problem.

wxfred commented 2 years ago

@wxfred how did you make these changes? I'm running into the same exact problem.

Change all related import to import Plotly from "plotly.js-dist"

those files are invovled:

compoments/methods.js
components/Plotly.vue

don't forget to npm install plotly.js-dist --save