Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wxfred opened this issue Apr 27, 2022 · 2 comments · May be fixed by #46
Open

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

wxfred opened this issue Apr 27, 2022 · 2 comments · May be fixed by #46

Comments

@wxfred
Copy link

wxfred commented Apr 27, 2022

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
Copy link

DnOberon commented Jul 7, 2022

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

@wxfred
Copy link
Author

wxfred commented Jul 8, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants