Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue and SSR cause hydration mismatches. #49

Open
gribbl opened this issue Dec 7, 2024 · 1 comment
Open

Vue and SSR cause hydration mismatches. #49

gribbl opened this issue Dec 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gribbl
Copy link

gribbl commented Dec 7, 2024

Package version

1.2.4

Describe the bug

Hello.

Recently, I wanted to try Inertia with Vue and SSR. Everything was fine until I created a layout. As shown in the attached images, I encountered few hydration issues. I've also attached a repro, which is simply a new Adonis project using the Inertia starter kit. Then, I added a layout, located at inertia/layouts/MainLayout.vue, and defined it in app.ts and ssr.ts as described in the Inertia documentation for setting a default layout. I also updated the @adonisjs/inertia package to version 1.2.4

Basically, it seems that whenever I update the content of a page, HMR crashes. This forces me to manually reload the browser after every change. With the repro, if I update the ref in home.vue located at inertia/pages, for example, it doesn’t work. Additionally, even if no warning message appears in the console, the content of the home page still disappears.

I’m on Windows 11 and I use Node 22.11.0, Chrome 131.0.6778.109 and Firefox 133.0.

image
image
image
image

Reproduction repo

https://github.com/gribbl/adonis-inertia-vue-ssr

@Julien-R44
Copy link
Member

It seems that the error only occurs when we have a layout and also only when upading a ref. If I update the layout itself or the HTML, no error occurs. Not sure to understand why now but I can confirm this looks like a bug

@Julien-R44 Julien-R44 added the bug Something isn't working label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants