Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cjholowatyj's avatar

Use of SASS/CSS Modules in Vite/Vue creates hydration class mismatch in Inertia SSR

I am using SASS/CSS in my Vite/Vue project, and just style modules working in my project, but now I'm noticing that it's creating a hydration class mismatch error when running SSR. The only apparent difference appears to be the hashes generated by CSS modules that are assigned within the classes...

Any thoughts on a solution to ensure the hashes are the same for ssr and non-ssr builds?

My Dev Stack: Laravel 10 / InertiaJS 1 / VueJS 3 / ViteJS 4 / TailwindCSS 3 / Vitest 0.31 / VitePress 1 / Typescript / (Inertia) SSR / FontAwesome Pro 6 / Ploi.io / Qodana / Cypress / ImgIX / HubSpot / SendGrid / SignEasy / Stripe

0 likes
4 replies
gych's avatar

Shouldn't your server side rendering and client side rendering use the same build? Can you share your vite config.

gych's avatar

Can you also share app.js and ssr.js ?

cjholowatyj's avatar

@gych Same Gist link updated to include my app.ts, ssr.ts, and my main.ts, which is used by both builds.

Please or to participate in this conversation.