JetStream CSS and JS not working and showing @vite(['resources/css/app.css', 'resources/js/app.js'])
Stefan Izdrail
Founder & Senior Architect · 2026-06-29
Title: Troubleshooting JetStream CSS and JS Issues in Laravel Applications
Body:
**Jetstream is a powerful front-end framework that combines Livewire, Laravel Mix, and Tailwind to provide an efficient development environment. However, sometimes developers encounter issues with the CSS and JavaScript integration. In this blog post, we'll walk you through common problems and offer solutions for your JetStream application.**
App.blade.php
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap">
<!-- Styles -->
@livewireStyles
<!-- Scripts -->
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body class="font-sans antialiased">
<x-jet-banner />
<div class="min-h-screen bg-gray-100">
@livewire('navigation-menu')
<!-- Page Heading -->
@if (isset($header))
<header class="bg-white shadow">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
{{ $header }}
</div>
</header>
@endif
<!-- Page Content -->
<main>
{{ $slot }}
</main>
</div">
@stack('modals')
@livewireScripts
</body>
</html>
1. Check Your Laravel Version: Make sure you are using the correct Laravel version that supports JetStream (Laravel 8+). If not, update your project to the latest stable release.
2. Clear Cache and Restart Server: Cache issues can sometimes cause problems with JetStream's CSS and JavaScript integration. Run `php artisan cache:clear` and restart your local server to ensure a fresh environment for testing.
3. Check Your Project Structure: Ensure that you have placed the files correctly within your project structure, as instructed by the Laravel documentation. Also, make sure that the specified paths in the code (resources/css/app.css and resources/js/app.js) are correct.
4. Verify Installation of Livewire and Laravel Mix: Confirm that you have installed and configured Livewire and Laravel Mix correctly as per the documentation. If not, refer to the installation guides for both packages.
5. Run NPM Commands: Ensure that your npm (Node Package Manager) is correctly installed and that you have run `npm install` and `npm run dev` in your project root directory. This will install all necessary dependencies and compile the assets.
6. Check Dependencies: Confirm that you are using the latest versions of Livewire, Laravel Mix, and their related packages, such as postcss-import, tailwindcss, autoprefixer, etc. If not, update them to the latest version by running `npm install` and `npm run dev` again.
7. Check Your Tailwind Configuration: Ensure that your tailwind.config.js file is correctly configured with the necessary imports and options relevant to your project. If necessary, refer to the Tailwind documentation for more guidance on customization.
8. Verify Your Jetstream Installation: Make sure you have installed and configured JetStream according to its official documentation, including setting up the correct folder structure and configuring your .env files.
9. Double-Check App.blade.php File: Review your app.blade.php file, particularly the code related to CSS and JavaScript integration (`@livewireStyles` and `@vite(['resources/css/app.css', 'resources/js/app.js'])`) as well as any other HTML or Livewire components.
10. Test Your Project: Run your project locally using `php artisan serve` or `npm run watch`, test your application, and see if the CSS and JavaScript are working correctly. If not, report the issue to the Laravel Company's GitHub repository for further assistance.
By following these troubleshooting steps, you should be able to resolve any issues with the JetStream integration in your Laravel application and ensure a smooth development experience. 