最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jsappjs file net::ERR_ABORTED 404 (Not Found) - Stack Overflow

programmeradmin3浏览0评论

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>

GET http://127.0.0.1:8000/js/app.js net::ERR_ABORTED 404 (Not Found)

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 7
  • 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
 |  Show 2 more ments

3 Answers 3

Reset to default 7

This 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

发布评论

评论列表(0)

  1. 暂无评论