alexjoverm / v-runtime-template

Vue component for compiling templates on the fly using a v-html like API
MIT License
605 stars 70 forks source link

Nuxt SSR problem on production #66

Closed andrewspy closed 4 years ago

andrewspy commented 4 years ago

I am encountering some problems when used in SSR on production on a certain template (it does not happen to all templates), and everything is working as expected in dev mode.

I have pasted the console log as below:

c32a8b51372e3ea25f0b.js:2 TypeError: Cannot read property '$scopedSlots' of undefined
    at c32a8b51372e3ea25f0b.js:2
    at prepatch (c32a8b51372e3ea25f0b.js:2)
    at S (c32a8b51372e3ea25f0b.js:2)
    at c32a8b51372e3ea25f0b.js:2
    at S (c32a8b51372e3ea25f0b.js:2)
    at c32a8b51372e3ea25f0b.js:2
    at S (c32a8b51372e3ea25f0b.js:2)
    at a.__patch__ (c32a8b51372e3ea25f0b.js:2)
    at a.t._update (c32a8b51372e3ea25f0b.js:2)
    at a.r (c32a8b51372e3ea25f0b.js:2)
DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.
    at Object.appendChild (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:116065)
    at v (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:132560)
    at l (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:132297)
    at h (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:132643)
    at A (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:135979)
    at A (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:135914)
    at a.__patch__ (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:136337)
    at a.t._update (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:109136)
    at a.r (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:143444)
    at pn.get (http://localhost:3000/_nuxt/c32a8b51372e3ea25f0b.js:2:102069)

I am a bit clueless on what's happening, I suspect it may have something to do with hydration, so would like to know if anyone has a similar issue or solution.

Note: I did use some custom component inside the template, and it's working perfectly fine on dev mode.

andrewspy commented 4 years ago

I am guessing it has something to do with hydration, and has found a detailed article on it:

https://blog.lichter.io/posts/vue-hydration-error/

Closing the issue.