Open codeflorist opened 9 months ago
Same with Nuxt.js 3.11
I've found a workaround for this problem.
Simply define the component and plugin-file as client-only by renaming them e.g. to components/WordCloud.client.vue
and plugins/vueWordCloud.client.ts
.
I tried your workaround, @codeflorist , and found some hint.
It works (even without forcing the client side), if I change the route from another page, but the error appears when I start with a route that contains the component.
So, it seems to have something to do with SSR: starting with the component active, rendering is done server-side and then it errors in this line:
for (var x2 = d2.getImageData(0, 0, m2, p2).data, S2 = [], F2 = 1 / 0, j2 = 0, O2 = 1 / 0, E = 0, W = m2 / 4, A = p2 / 4, B = 0; B < W; ++B) for (var C = 0; C < A; ++C) __vite_ssr_import_0__.h: for (var L = 0; L < 4; ++L) for (var = 0; < 4; ++_) {
The last for
in the line uses an invalid expression (< 4
). This seems not to happen if the code is rendered later on the client side.
Using this package with Nuxt versions higher than v3.8 throws the following error:
here is a reproduction: https://stackblitz.com/edit/nuxt-starter-erkavw?file=package.json
changing nuxt dependency to
~3.8.0
fixes the problem.