chrisvfritz / prerender-spa-plugin

Prerenders static HTML in a single-page application.
MIT License
7.31k stars 633 forks source link

Plugin creates broken HTML #453

Open maartenelgar opened 3 years ago

maartenelgar commented 3 years ago

When I use the plugin my index.html file in dist, my file has a copy mistake. I am unsure whats causing it and I have tried changing alot of the parameters for the plugin aswell as adding .replace(id="app", id="app" data-server-rendered="true"); to the post process and trying to add id="app" to the App.vue file as advised on some stackoverflow threads.

Any ideas what could be driving this?

</body></html>ontrolheight="81" style="margin: 10px; user-select: none; position: absolute; bottom: 95px; right: 40px;"><div class="gmnoprint" controlwidth="40" controlheight="81" style="position: absolute; left: 0px; top: 0px;">

maartenelgar commented 3 years ago

The issue was caused by hydration failures which I learnt were misuses of html components. When i went through my code and resolved those misuses it resolved the the prerendering issue.

For anyone else struggling with this issue you can read more here:

https://www.sumcumo.com/en/understand-and-solve-hydration-errors-in-vue-js