livewire: 404 for livewire.js when not using php artisan serve
Describe the bug
I have the counter livewire example app being served from the htdocs folder of my local xampp.
When I access the app I get a 404 for the livewire.js file.
However when I use use php artisan serve to serve the app and access it the livewire.js is served correctly
To Reproduce Steps to reproduce the behavior:
- Create a new laravel app.
- Install livewire in it
- Serve or run it with a normal web server instead of
php artisan serve - See error in the network tabs of the browser
Expected behavior Expected the path to the livewire.js file to be resolved correctly no matter where itsa being served from
Screenshots
Error when served from localhost with a webserver

Loaded correctly when served with php artisan serve

Desktop (please complete the following information):
- Browser - chrome
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (5 by maintainers)
Commits related to this issue
- Merge pull request #84 from livewire/fix/missing-components-resolver-register [3.x] Fixes registering missing components — committed to livewire/livewire by taylorotwell a year ago
@RafaTorices try run:
php artisan livewire:publishthen open config/livewire.php change'asset_url' => nullto'asset_url' => 'http://localhost/laravel8/public'okay, let’s try once again with follow this steps
php artisan migrate)http://localhost/laravel8/public/registerphp artisan vendor:publish --tag=jetstream-viewsphp artisan livewire:publish --assetsphp artisan livewire:publish'asset_url' => nullto'asset_url' => 'http://localhost/laravel8/public'I to do that and everything running well without artisan serve
Just notice when publishing vendor files it works:
According docs this is not mandatory.
@calebporzio … sweet…will test and feedback…thanks