Paulo Fonseca
Paulo Fonseca

Reputation: 59

Laravel 8 - GET http://localhost:8000/css/app.css net::ERR_ABORTED 404 (Not Found)

I can't use the app.css in my application. Every time the server returns following error

GET http://localhost:8000/css/app.css net::ERR_ABORTED 404 (Not Found).

I use a blade page.

<link href="{{ asset('css/app.css') }}" rel="stylesheet">

I tried to use php artisan serve and php -S localhost:8000 -t public and the booth didn't work.

Upvotes: 4

Views: 14432

Answers (4)

Marvel C
Marvel C

Reputation: 1

This the step for installing:

composer require laravel/ui --dev

php artisan ui bootstrap

php artisan ui bootstrap --auth

npm install

npm run dev

If you get an error at this step you can try this:

npm run prod or npm run production

Upvotes: -1

Rakesh kumar Oad
Rakesh kumar Oad

Reputation: 1346

Use this worked 100%

run this command

npm i vue-loader

then run

npm run dev

you will get your solution .

Upvotes: -1

tameemahmad shahzad
tameemahmad shahzad

Reputation: 577

try this before running your project on server make sure to compile laravel-mix

npm install

and then run

npm run dev

your facing the error because app.css not compiled yet

Upvotes: 7

Ivan Cristobal
Ivan Cristobal

Reputation: 323

Make sure you compile your css imports properly in resources/css/app.css first. It should look something like this:

// Fonts
@import url('https://fonts.googleapis.com/css?family=Nunito');

// Bootstrap
@import 'bootstrap';

// Font Awesome
@import '@fortawesome/fontawesome-free';

Then, run this on your terminal: npm run dev. This will in turn, compile your app.css in your public/css. If you are making custom css definitions, i suggest using a custom.css and putting it in your public/css folder, and define it BELOW your app.css, like:

<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('css/custom.css') }}" rel="stylesheet">

Assets must always be in the public folder so they can be seen by the {{asset ('') }} command.

Upvotes: 0

Related Questions