I'm setting up an authentication in laravel5
, but js
and css
don't work on my web page
<script src="{{ asset('js/app.js') }}"></script>
GET http://127.0.0.1:8000/js/app.js net::ERR_ABORTED 404 (Not Found)
I'm setting up an authentication in laravel5
, but js
and css
don't work on my web page
<script src="{{ asset('js/app.js') }}"></script>
Share Improve this question edited Sep 19, 2019 at 11:51 Gayan S. Muthukumarana 9041 gold badge11 silver badges29 bronze badges asked Sep 19, 2019 at 11:31 JamilaJamila 1111 gold badge2 silver badges10 bronze badges 7GET http://127.0.0.1:8000/js/app.js net::ERR_ABORTED 404 (Not Found)
- what's file location from root folder? – Rahul Commented Sep 19, 2019 at 11:32
- mywebsite/ressource/js/js.app – Jamila Commented Sep 19, 2019 at 11:35
- move js folder in public folder. it will work. – Rahul Commented Sep 19, 2019 at 11:36
- mywebsite/public/js/app.js should be the root path and then you can access 127.0.0.1:8000/js/app.js this – Rahul Commented Sep 19, 2019 at 11:37
- i did it but it doesn't work – Jamila Commented Sep 19, 2019 at 11:45
3 Answers
Reset to default 7This problem happened to me but with Laravel 6, I solved it this way
poser require laravel/ui
php artisan ui vue --auth //you can use vue boostrap --auth is to add the login paths and
register
npm install
npm run dev
sorry if my English is not well written
You can try referencing you app.js and app.css as follows:
@vite(['resources/sass/app.scss', 'resources/js/app.js'])
You should be able to succesfully find these.
in my case npm mand pointed to wrong place. To check that try:
get-mand npm
reset its path in system variable path
and go :
npm install
npm run dev
only then settled it all