spatie / server-side-rendering

Server side rendering JavaScript in a PHP application
https://sebastiandedeyne.com/posts/2018/server-side-rendering-javascript-from-php
MIT License
602 stars 34 forks source link

Root element does not get id attribute #31

Closed jameswagoner closed 4 years ago

jameswagoner commented 4 years ago

When I have a successful ssr response:

<div data-server-rendered="true">

You still find a console error complaining about not finding #app.

Isn't vue-server-renderer supposed to add this on the root element as well?

<div id="app" data-server-rendered="true">
reed-jones commented 4 years ago

No it doesn't, you need to add this to your root template yourself. https://ssr.vuejs.org/guide/hydration.html

Note that it didn't add id="app", just the data-server-rendered attribute: you need to add the ID or some other selector to the app's root element yourself or the app won't hydrate properly.

spatie-bot commented 4 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.