The requested URL /vendor/livewire/livewire.js was not found on this server. In my project I have laravel livewire I don't know why this error encounter..
in console it returns this error.
create:77 Uncaught ReferenceError: Livewire is not defined
can anyone tells me what I did wrong the problem
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css">
@livewireStyles
</head>
<body>
<main class="py-4">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<livewire:counter />
</div>
</div>
</main>
@livewireScripts
</body>
</html>
Now I have solved this issue by changing the asset_url in the livewire.config file
first run php artisan vendor:publish
then select livewire config file
After that open file and edit asset_url null to your filename
'asset_url' => 'MY_PROJECT_NAME',
In My project case what i did is
. I changed the asset_url to "http://localhost/PROJECT_DIRECT/public
As the public folder has all Js assets for Laravel generated by composer
Now the project is working fine
Please sign in or create an account to participate in this conversation.