question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS file paths in Vite 3 manifest broken on Windows

See original GitHub issue
  • Laravel Vite Plugin Version: 0.5.0
  • Laravel Version: 9.21.3
  • Node Version: 16.13.2
  • NPM Version: 8.1.2
  • Host operating system: Windows
  • Web Browser & Version: Chrome - Version 103.0.5060.134 (Official Build) (64-bit)
  • Running in Sail / Docker: No

Description:

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

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

After running this command:

npm run build

Getting this error:

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

Steps To Reproduce:

I have done some research on it.

there is an issue in the manifest.json file.

{
  "resources/js/app.js": {
    "file": "assets/app.8fe7c9ab.js",
    "src": "resources/js/app.js",
    "isEntry": true
  },
  "resources/css\\app.css": {
    "file": "assets/app.8794147c.css",
    "src": "resources/css\\app.css"
  }
}

Screenshot_57

and in the Vite.php this manifest key is not matching.

Screenshot_58

that’s why js files working fine and css files having issues.

please fix this, thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
schonhoffcommented, Jul 29, 2022

Thanks for the fix! It worked!!!

1reaction
AhsanAbrarcommented, Jul 29, 2022

@timacdonald You did a great job! Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS file paths in Vite 3 manifest broken on Windows #9295
Hello,. after upgrading to vite version 3 and the laravel-plugin matching the version (version 0.5.0), I can't use build on a windows computer ......
Read more >
Unable to locate file in Vite manifest: resources/css/app.css
@Shaden There seems to be a bug on Windows, where the CSS file path when built contains a backslash in the path, causing...
Read more >
Backend Integration - Vite
Backend Integration # · The manifest has a Record<name, chunk> structure · For entry or dynamic entry chunks, the key is the relative...
Read more >
Vite manifest not found - Stack Overflow
I tried to solve the problem but nothing work, I need to change the public folder and the sup folder build file place...
Read more >
unable to locate file in vite manifest: resources/js/app.js. - You.com ...
i'm using Asset Bundling (Vite) to show my css and js files, but i'm getting this ... vitejs/viteCSS file paths in Vite 3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found