jcc5018's avatar

Vite manifest not found

I recently got a new computer and although I believe vite worked for a while with the new set up, something has since broken, and I am not sure what might have broke. (i'm dealing with cancer so its been a while since i upgraded to know for sure) I'm wonderinf if perhaps there is a system configuration that I need to identify and fix as all the standard steps to fix have been done numerous times.

I am getting the error: Unable to locate file in Vite manifest: resources/css/app.css.

yet the files appear in my file structure.

Vite config :

import {defineConfig} from 'vite'
import laravel, {refreshPaths} from 'laravel-vite-plugin'

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            refresh: [
                ...refreshPaths,
                'app/Livewire/**',
            ],
        }),
    ],
})

postcss.config.js

export default {
    plugins: {
        'tailwindcss/nesting': 'postcss-nesting',
        'tailwindcss': {},
        'autoprefixer': {},
    },
};

tailwind.config.js

resources/css/filament/admin/tailwin.config.js

import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
    presets: [preset],
    content: [
        './app/Filament/**/*.php',
        './resources/views/filament/**/*.blade.php',
        './vendor/filament/**/*.blade.php',
        './vendor/ralphjsmit/laravel-filament-media-library/resources/**/*.blade.php'
    ],
}

package.json

{
    "private": true,
    "type": "module",
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.5.7",
        "@tailwindcss/typography": "^0.5.12",
        "autoprefixer": "^10.4.20",
        "daisyui": "^4.12.13",
        "laravel-vite-plugin": "^1.0.2",
        "postcss": "^8.5.3",
        "postcss-nesting": "^13.0.1",
        "tailwindcss": "^3.4.17",
        "vite": "^6.1.0"
    },
    "dependencies": {
        "latest-version": "^9.0.0",
        "text-diff": "^1.0.1"
    }
}

I had tried tailwind 4.0 as well but filament doesnt seem to be compatible yet.

Using laravel 11.43.1

response from npm run build:

vite v6.1.0 building for production...
transforming (1) resources\js\app.js
🌼   daisyUI 4.12.23
├─ ✔︎ 6 themes added            https://daisyui.com/docs/themes
╰─ ★ Star daisyUI on GitHub     https://github.com/saadeghi/daisyui

✓ 2 modules transformed.
Generated an empty chunk: "app".
public/build/manifest.json              0.27 kB │ gzip:  0.15 kB
public/build/assets/app-BPKqs7eD.css  263.41 kB │ gzip: 40.93 kB
public/build/assets/app-l0sNRNKZ.js     0.00 kB │ gzip:  0.02 kB
✓ built in 3.45s


manifest.json

{
  "resources/css/app.css": {
    "file": "assets/app-BPKqs7eD.css",
    "src": "resources/css/app.css",
    "isEntry": true
  },
  "resources/js/app.js": {
    "file": "assets/app-l0sNRNKZ.js",
    "name": "app",
    "src": "resources/js/app.js",
    "isEntry": true
  }
}

I think that is everything connected to this system, so im not sure what else to do at this point, but i cant do anything with my app as long as this error persists

1 like
10 replies
vincent15000's avatar

Have you just forgot to execute npm run build ?

1 like
RemiM's avatar
  1. Maybe try to change your refresh entry in your vite.config.js for something more generic:
 refresh: true,
  1. Check in your blade entry point and if you have the directive @vite properly setup.

  2. What do you have in your app.css file? Check that everything is there, and, if needed, reduce to have only the Tailwind directives.

  3. You can eventually remove your NPM related files and folders and rebuild them:

rm -rf node_modules package-lock.json

And then:

npm install

Note: don't forget to run your NPM in order to check if everything is working properly.

1 like
martinbean's avatar

@jcc5018 You say that the file (resources/css/app.css appears in your file structure but then don‘t show that file; you don’t show any CSS files.

So, are you sure resources/css/app.css does exist (because it would be weird to get an error saying it doesn’t exist otherwise)?

1 like
jcc5018's avatar

@martinbean

Looks like it exists to me. Structure But im also on a lot of pain killers, so am i missing something?

colors.css

grid.css

layout.css

to name a few

I am trying to figure out the best way to simplify things while allowing my own CSS. But I am also trying to utilize what tailwinds has to offer as well so im not repeating things. But there are some instances where it would be cleaner to make my own classes where I tried to separate into independent files based on purpose.

currently, I think Tailwind itself gets loaded several times between daisyUI, filament, and probably some other packages.

Im not sure what i broke that caused the manifest to not generate or be viewable when i know it did work on my laptop before updating, and fairly sure at least once on my desktop.

Thanks

1 like
martinbean's avatar

@jcc5018 It looks to exist inside a filament folder to me, which would make the path resources/css/filament/app.css and not resources/css/app.css, hence the error from Vite.

You’ll therefore need to update your Vite config:

  export default defineConfig({
      plugins: [
          laravel({
-             input: ['resources/css/app.css', 'resources/js/app.js'],
+             input: ['resources/css/filament/app.css', 'resources/js/app.js'],
              refresh: [
                  ...refreshPaths,
                  'app/Livewire/**',
              ],
          }),
      ],
  })
1 like
jcc5018's avatar

@martinbean oh good grief I hope that isn't really the issue. I'll try when I get out of hospital. Though I do remember copying the path itself when pasting to ensure no error. But not sure when it would have moved.

I hope that's really the only problem

2 likes
jcc5018's avatar

@martinbean

sorry for delayed response. and any typos as I have no feeling in my fingers

the app and other CSS files are definitely in the resource/css file. ( I made sure to drag directly to desired folder, and even tried your paths to be sure which had wrong path errors.

So there's something preventing the reading of that app.css and I cant figure out what

when I do a cache clear, I do get an error,

Warning: Version warning: Imagick was compiled against ImageMagick version 1808 but version 1809 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0

INFO Clearing cached bootstrap files.

cache ............................................................................................................................... 51.41ms DONE compiled ............................................................................................................................. 2.66ms DONE config ............................................................................................................................... 0.97ms DONE events ............................................................................................................................... 0.79ms DONE routes ............................................................................................................................... 0.98ms DONE views ............................................................................................................................... 47.33ms DONE blade-icons .......................................................................................................................... 0.35ms DONE filament ............................................................................................................................. 1.45ms DONE

not sure if imagick has anything to do with it but something for consideration?

1 like
martinbean's avatar

@jcc5018 I don’t really know what that has to do with Vite saying it can’t find a file…?

1 like
jcc5018's avatar

@martinbean dont know, just throwing out other possible issues cause in the past, issues have been some random extension or computer setting that had nothing to do with the code, and I have no idea how to figure out things like that.

Like id be working on some file, and a commented setting in PHP.ini or something was breaking the whole project. presenting false errors. I'm thinking this may be one of those things considering the change of computer, but no idea how to even go about debugging to that level

1 like
martinbean's avatar

@jcc5018 Show a screenshot of your file tree, with all folders under resources expanded, and the full error message you’re getting if you try and run npm run build now.

1 like

Please or to participate in this conversation.