@vite( 'resources/css/app.css' 'resources/js/app.js' ) is not working with laravel 9, vite 4.0.0
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
# Debugging the Vite Headache: Why `@vite` Fails in Laravel 9 Jetstream Setups
As a senior developer working within the vibrant Laravel ecosystem, I've seen countless times where seemingly straightforward setup steps lead to frustrating runtime errors. One of the most common pain points revolves around asset bundling and compilation, especially when integrating modern tools like Vite.
A frequent sticking point for developers setting up new projects with Jetstream and Livewire—particularly those transitioning into newer Laravel versions or specific Vite configurations—is the failure of the `@vite` directive to load compiled CSS and JavaScript.
If you are running into issues where `@vite('resources/css/app.css', 'resources/js/app.js')` does nothing, it usually signals a problem deeper in the build process or configuration rather than just a simple typo in the Blade file. Let's dive into why this happens and how to fix it for Laravel 9 and Vite 4.0.0 environments.
## Understanding the `@vite` Mechanism
The `@vite` directive is Laravel’s streamlined way of referencing assets built by Vite. When you use this directive, Laravel expects to find a manifest file (usually `manifest.json`) generated by the Vite build process. This manifest tells the browser exactly which hashed and compiled CSS and JavaScript files to load, ensuring cache busting and correct asset loading.
The failure usually occurs because one of the following steps is incomplete or misconfigured:
1. **Vite Build Failure:** The initial compilation (`npm run dev` or `npm run build`) did not successfully create the necessary output files.
2. **Pathing Error:** The paths specified within the `@vite()` call do not match the actual file structure or the configuration defined in `vite.config.js`.
3. **Post-Build Steps Skipped:** The asset compilation was missed, meaning the manifest file doesn't exist when the blade template is rendered.
## Troubleshooting Steps for Laravel Jetstream/Vite Issues
Based on your setup involving `composer require laravel/jetstream`, `php artisan jetstream:install livewire`, and running `npm run build`, here are the most likely culprits and solutions.
### 1. Verify the Vite Build Process
The absolute first step is ensuring that the frontend assets have been correctly compiled for production. If you are working in a standard Laravel setup, you must ensure you run the full build command:
```bash
npm install
npm run build
```
If