Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS file paths in Vite 3 manifest broken on Windows #9295

Closed
7 tasks done
schonhoff opened this issue Jul 22, 2022 · 3 comments · Fixed by #9353
Closed
7 tasks done

CSS file paths in Vite 3 manifest broken on Windows #9295

schonhoff opened this issue Jul 22, 2022 · 3 comments · Fixed by #9353
Labels
feat: css p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) windows only

Comments

@schonhoff
Copy link

Describe the bug

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 because there is an error for the css file not matching the correct form in the manifest.json.

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,
        }),
    ],
});

After running this command:

npm run build

Getting this error:

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

Someone already reported the issue on the Laravel plugin but the maintainer mentioned it is a vite bug.
See for more information: laravel/vite-plugin#101

Thanks for the great tool!

Reproduction

https://github.com/schonhoff/example-app-vite

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 19.12 GB / 31.94 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    npm: 8.13.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.62)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vite: ^3.0.0 => 3.0.2


Laravel Vite Plugin Version: 0.5.0
Laravel Version: 9.21.4
Host operating system: Windows
Web Browser & Version: Chrome - Version 103.0.5060.134 (Offizieller Build) (64-Bit)
Running in Sail / Docker: No
Webserver: WAMP

Used Package Manager

npm

Logs

There is an issue in the manifest.json file. After npm run build the following manifest file was created.

{
  "resources/js/app.js": {
    "file": "assets/app.ab93cf8a.js",
    "src": "resources/js/app.js",
    "isEntry": true
  },
  "resources/css\\app.css": {
    "file": "assets/app.1776c6d9.css",
    "src": "resources/css\\app.css"
  }
}

The errors are the \\ on the app.css.

Validations

@sapphi-red sapphi-red added windows only p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) labels Jul 22, 2022
@TiagoSilvaPereira
Copy link

I had the same problem here: laravel/jetstream#1098 (comment)

@timacdonald
Copy link
Contributor

I've opened a PR to address this. I would absolutely love if someone could test this fix for me as I cannot actually test this fix locally.

See: #9353

patak-dev pushed a commit that referenced this issue Jul 25, 2022
Co-authored-by: sapphi-red <green@sapphi.red>
@timacdonald
Copy link
Contributor

FYI this has now been tagged. Please update to v3.0.4

see: https://github.com/vitejs/vite/blob/v3.0.4/packages/vite/CHANGELOG.md

@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: css p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) windows only
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants