meysam Zare
meysam Zare

Reputation: 11

Unable to locate file in Vite manifest:

i'm using Asset Bundling (Vite) to show my css and js files, but i'm getting this error

Unable to locate file in Vite manifest: resources/demo/demo.css.

there is a dot at the end of the address.

this is my vite.config.js

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/demo/demo.css',
                'resources/js/app.js',
            ],
            refresh: true,
        }),
    ],
});

And I use this code in blade:

@vite(['resources/demo/demo.css'])

"laravel":v9.30.1

PHP v8.1.6

"vite": "^3.0.0"

Upvotes: 1

Views: 3559

Answers (2)

farz
farz

Reputation: 36

Check your package.json. Verify the script for build is written.

  "scripts": {
        "dev": "vite",
        "build": "vite build",
        "watch": "vite build --watch"
    },

Now run this command : npm run build

Upvotes: 0

Joukhar
Joukhar

Reputation: 872

in ur vite config file

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/css/material-dashboard.css',
                'resources/js/app.js',
                'resources/demo/demo.css'
            ],
            refresh: true,
        }),
    ],
});

run this command : npm run build

then congratulations !

Upvotes: 0

Related Questions