You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first render of OptimizedAsyncFunctionalComponent fails, but subsequent ones succeed.
It appears that vue-server-renderer calls installSSRHelpers which adds _ssrNode and other SSR optimization helpers to Vue.prototype and Vue.FunctionalRenderContext.prototype. However, when rendering an async functional component, the built version of vue-server-renderer has its own definition of FunctionalRenderContext (appears to be bundled at build time along with things like createFunctionalComponent instead of importing from vue itself at runtime) which does not have the SSR helpers on it.
Setting optimizeSSR: false in vue-loader options seems to work as a bandaid solution since the optimization helpers are not used, but this seems like a bad idea for performance.
EDIT: also, changing it to a regular component (not functional) also works as a workaround
The text was updated successfully, but these errors were encountered:
Version
2.7.14
Reproduction link
stackblitz.com
Steps to reproduce
Run
main.js
in the reproduction linkWhat is expected?
Each render in that reproduction would work
What is actually happening?
The first render of
OptimizedAsyncFunctionalComponent
fails, but subsequent ones succeed.It appears that
vue-server-renderer
callsinstallSSRHelpers
which adds_ssrNode
and other SSR optimization helpers toVue.prototype
andVue.FunctionalRenderContext.prototype
. However, when rendering an async functional component, the built version ofvue-server-renderer
has its own definition ofFunctionalRenderContext
(appears to be bundled at build time along with things likecreateFunctionalComponent
instead of importing from vue itself at runtime) which does not have the SSR helpers on it.Setting
optimizeSSR: false
invue-loader
options seems to work as a bandaid solution since the optimization helpers are not used, but this seems like a bad idea for performance.EDIT: also, changing it to a regular component (not functional) also works as a workaround
The text was updated successfully, but these errors were encountered: