LaravelDaily/Larastarters

Volt 5 error

gerardp opened this issue · 9 comments

[vite:css] [postcss] Failed to find '@fortawesome/fontawesome-free/scss/fontawesome.css'
in [
/Users/llaa/Desktop/projects/starter/volt/resources/sass
]
file: /Users/llaa/Desktop/projects/starter/volt/resources/sass/app.scss:undefined:undefined
error during build:
Error: [postcss] Failed to find '
@fortawesome/fontawesome-free/scss/fontawesome.css'
in [

Sorry, i did a clean installation and still fails:


[plugin:vite:css] [postcss] Failed to find '@fortawesome/fontawesome-free/scss/fontawesome.css'
  in [
    /Users/user/Desktop/projects/starter/volt/resources/sass
  ]

    at file:///Users/user/Desktop/projects/starter/volt/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:93:13
    at async Promise.all (index 0)
    at async LazyResult.runAsync (/Users/user/Desktop/projects/starter/volt/node_modules/postcss/lib/lazy-result.js:396:11)
    at async compileCSS (file:///Users/user/Desktop/projects/starter/volt/node_modules/vite/dist/node/chunks/dep-3007b26d.js:36728:25)
    at async TransformContext.transform (file:///Users/user/Desktop/projects/starter/volt/node_modules/vite/dist/node/chunks/dep-3007b26d.js:36194:56)
    at async Object.transform (file:///Users/user/Desktop/projects/starter/volt/node_modules/vite/dist/node/chunks/dep-3007b26d.js:41660:30)
    at async loadAndTransform (file:///Users/user/Desktop/projects/starter/volt/node_modules/vite/dist/node/chunks/dep-3007b26d.js:39466:29

Click outside or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.js.
krekas commented

@gerardp does removing .css in resources/sass/app.scss fix the problem? If so, can you make pr?

krekas commented

All good for me
image

All good for me image

I just did a clean installation, these are the commands I'm typing. I'm still having the same problem.


composer create-project laravel/laravel volt && cd volt 

composer require laraveldaily/larastarters --dev  

php artisan larastarters:install

npm install && npm run dev

php artisan serve
krekas commented

Did you try removing extension where I told you and then recompiling again?

Yes, and then give me this error:

$ npm run build

> build
> vite build

vite v4.1.1 building for production...
✓ 0 modules transformed.
Could not resolve entry module "resources/sass/app.scss".
error during build:
RollupError: Could not resolve entry module "resources/sass/app.scss".
    at error (file:///Users/user/Desktop/projects/starter/volt2/node_modules/rollup/dist/es/shared/rollup.js:2091:30)
    at ModuleLoader.loadEntryModule (file:///Users/user/Desktop/projects/starter/volt2/node_modules/rollup/dist/es/shared/rollup.js:23354:20)
    at async Promise.all (index 0)

So i remove the references in:

  • app.blade.php
  • vite.config.js

But the problem is still there

Captura de pantalla 2023-02-14 a las 12 13 27

krekas commented

You clearly doing not what I told you. In file app.scss which is founded in resources/sass there is a line @import "@fortawesome/fontawesome-free/scss/fontawesome.css"; remove from it .css as I said earlier and then try recompile.

The resources/sass/app.scss now should look like this:

$fa-font-path: "@fortawesome/fontawesome-free/webfonts";

@import "@fortawesome/fontawesome-free/scss/fontawesome";
@import "@fortawesome/fontawesome-free/scss/solid";

@import "volt";

.invalid-feedback {
    display: block;
}

.main {
    min-height: calc(100vh - 180px);
}

.table > :not(:first-child) {
    border-top: 0;
}

It works perfectly, thank you.