alexcode / vue2vis

A Vuejs 2 adapter for Visjs
MIT License
217 stars 59 forks source link

Webpack problem #26

Closed skystar-p closed 6 years ago

skystar-p commented 6 years ago

After upgrading this package to 0.0.14, Vue fail to load vue2vis, saying window is not defined (even if the SSR is off).

I solved this problem by adding config.output.globalObject = 'this' in ./scripts/webpack.js. But I want to inspect this issue more detailed.

Can you take a look at this issue?

alexcode commented 6 years ago

Thanks for the report, this seems to be related to https://github.com/webpack/webpack/issues/6525. This bug will affect webworker and node environments like SSR. However, this feature will only be added in Webpack 5, so, the proper workaround is setting config.output.globalObject = 'this'. I will send a fix today.

alexcode commented 6 years ago

@skystar-p could you confirm the issue is fixed for you in v0.0.15 ?

skystar-p commented 6 years ago

@alexcode Yes, it works like a charm. Thank you for the fast fix!