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

MekouRaouf's avatar

Jetstream css not working in laravel 9 + vue 3 project

I implemented an app using the stack Laravel 9 + InertiaJs + vue 3 + element plus and jetstream for authentication. After building using npm run build of vite, i imported manifest.json entry point files. My app doesn't read css

0 likes
21 replies
Sinnbeck's avatar

What do you mean by

i imported manifest.json entry point files

MekouRaouf's avatar

@Sinnbeck after building assets with vite, used app.js generated chunk file in my default blade template file.

MekouRaouf's avatar

@Sinnbeck

@php
    $manifest = json_decode(file_get_contents(public_path('build/manifest.json')), true);
@endphp

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="dark">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title inertia>{{ config('app.name', 'Laravel') }}</title>        
	<link rel="stylesheet" href="/build/{{ $manifest["resources/js/app.js"]["css"][0] }}">
        @routes
        @inertiaHead
    </head>
    <body class="font-sans antialiased hold-transition sidebar-mini">
        @inertia
        <x-translations></x-translations>

       	<script type="module" src="/build/{{ $manifest["resources/js/app.js"]["file"] }}"></script>
  </body>
</html>

This is the default blade template file

Sinnbeck's avatar

@MekouRaouf Why are you doing this manually? Just let it use vite as its meant to?

@vite(['resources/js/app.js'])
MekouRaouf's avatar

@Sinnbeck part of manifest.json file

{
  "resources/js/app.js": {
    "file": "assets/app.e1774093.js",
    "src": "resources/js/app.js",
    "isEntry": true,
	"dynamicImports": [
         "resources/js/Pages/API/Index.vue",
    	 "css": [
           "assets/app.cbdb82da.css"
         ],
     ],
}

MekouRaouf's avatar

@Sinnbeck i did that beacause I'm trying to migrate from development environment to production

add https// -> imgur.com/sf0h4zL

Sinnbeck's avatar

@MekouRaouf That is also built in. Run npm run build and you are done. No need to change any files

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@MekouRaouf According to that screenshot you are running npm run dev? If not, then delete the file named hot in the public directory

Sinnbeck's avatar

@MekouRaouf Any errors in the console this time? Or do you mean you made some changes afterwards that didnt show up?

MekouRaouf's avatar

@Sinnbeck Thanks for your help. solution: laracasts.com/discuss/channels/laravel/unable-to-locate-file-in-vite-manifest-resourcescssappcss?reply=813810

Sinnbeck's avatar

@MekouRaouf Good. Then mark a best answer to close the thread. But there was no way we could have known as you havent shown any of your files (except the manifest) :)

Please or to participate in this conversation.