Closed robindierckx closed 4 years ago
Please see the response of the nuxt team:
If you check the source of the component, you can see that the initialization of this.sourceData is done in the beforeMount lifecycle hook. Unfortunately, that hook is not run by Vue when doing SSR, so there's nothing to do on Nuxt or Vue side. That library is not compatible with SSR
How can we make this plugin compatible with SSR ?
Solution was to define source directly
<vue-markdown :source = content ></vue-markdown>
In combination with nuxt, vue-markdown doesn't pre-render when running
nuxt generate
.The element is there but, the content doesn't appear on the generated html page (the vue-markdown element is empty), although it works perfectly fine in spa mode. This is because the vue-markdown parsing logic is not executed in SSR mode. It would be great to add this feature, or offer the possibility to pre-process the html in nuxt's
asyncData
orfetch
function.