Which version are you on cause in the docs it says "Include the JavaScript (on every page that will be using Livewire)."
...
@livewireStyles
</head>
<body>
...
@livewireScripts
</body>
</html>
I'm using laravel 8 and im getting error Uncaught ReferenceError: Livewire is not defined
and i don't want to publish livewire assets
Which version are you on cause in the docs it says "Include the JavaScript (on every page that will be using Livewire)."
...
@livewireStyles
</head>
<body>
...
@livewireScripts
</body>
</html>
im using laravel 8.12
and your soluion is not working for me.
my laravel direcotry is /var/www/html/laracast/cashier and livewire is looking for localhost and sending me this eror Uncaught ReferenceError: Livewire is not defined
script takking from localhost folder http://localhost/livewire/livewire.js?id=936e5d0fb0b76b631ba7
Did you ran php artisan livewire:publish --assets to publish frontend assets?
i have ran php artisan livewire:publish --assets to publish assets but still same error
http://localhost/vendor/livewire/livewire.js?id=936e5d0fb0b76b631ba7 net::ERR_ABORTED 404 (Not Found) invoices:307 Uncaught ReferenceError: Livewire is not defined
In your .env file, verify the APP_URL.
APP_URL=http://127.0.0.1:8000 // match this and try again
its working with artisan serve but when i'm running with out artisan serve command then its not working
in Your config/livewire.php change the asset_url to public
/*
|--------------------------------------------------------------------------
| Livewire Assets URL
|--------------------------------------------------------------------------
|
| This value sets the path to Livewire JavaScript assets, for cases where
| your app's domain root is not the correct path. By default, Livewire
| will load its JavaScript assets from the app's "relative root".
|
| Examples: "/assets", "myurl.com/app".
|
*/
'asset_url' => 'public',
and that's because livewire published the vendor folder to your public dir
If you use xampp you should change asset_url to ../ in your config/livewire.php. You get this file by entering this command: php artisan livewire:publish --config
In my case I add to put in env file my true url http://localhost/projets/mysite/public and to put in config/wire 'asset_url' => env('APP_URL', 'http://localhost'),
and then it worked
Such problems ALWAYS stem from hosting the Laravel app in an invalid and (likely) insecure manner
For my case, as my web url is [ ip address/projectName/public/ ] I change the livewire's asset url to '../public'
'asset_url' => '../public',
@Blockhunt it's work for me, how about config/wire app_url sir ? My project is access ip address too
Please or to participate in this conversation.