inertiajs SSR Flash Of Unstyled Content Hello,
I am using Laravel 10 / vue3 / vite / inertiajs SSR and I am experiencing "Flash Of Unstyled Content" because tailwindcss isn't loading.
When I first load my page, everything is unstyled and then it flicks to the tailwindcss styling.
Any idea on how to fix this?
How are you using tailwind in your project?
Did you install the package and if so how did you add it to your project or do you use cdn ?
@gych normal installation through the laravel breeze package. php artisan breeze:install vue --ssr
Smaller pages work fine, it's just that I have a big front page with multiple sections on a single page such as services, contact, and more.
@koko1 Ok and how is tailwind imported in your project? Do you have the same issue when you build the application npm run build and open it from the public folder? laravel_app/public/index.php ?
@gych you can reproduce this by creating a fresh laravel project install breeze vue --ssr.
visiting /register or /login you will see exactly what I mean.
I found this inertiajs/inertia/issues/1760 (cant post links), which seem to have a PR already maybe it will get fixed.
@koko1 did you find a solution for this? I'm experiencing the same problem with breeze and vue. It flashes the unstyled page for a second and then loads it
@jrenzi hey sorry for the late reply, yes I have.
vite.config.js
input: ["resources/css/app.css", "resources/js/app.ts"]
app.blade.php
@vite (['resources/css/app.css','resources/js/app.ts', "resources/js/Pages/{$page['component']}.vue"])
@koko1 Adding app.css to vite fixed it. But do you know why?
Please sign in or create an account to participate in this conversation.