Livewire.js net::ERR_ABORTED 404 Not Found

What seems to be the problem:
GET http://localhost/vendor/livewire/livewire.js?id=d9e06c155e467adb5de2 net::ERR_ABORTED 404 (Not Found)
form:75 Uncaught ReferenceError: Livewire is not defined
at form:75
Steps to Reproduce:

Are you using the latest version of Livewire:
“php”: “^7.3|^8.0”,
“livewire/livewire”: “^2.3”

Do you have any screenshots or code examples:
I tried all sorts of ways to fix the problem, but it didn’t work. why

do you declare the livewire blade directives for @livewireScripts and @livewireStyles? Can you check in the inspector or browser devTool that your blades are loading this directives?

@livewireScripts this directive is not loading.

and where do you put this directives? main app blade for example? Check for this this because there is your issue…I mean, isn’t loading the asset

I put the directives in resources/views/layouts/app.blade.php
livewire.js my is in public/vendor/livewire/livewire.js

aja…and in body tag of that app.blade you yield the content of the components right? Or the component…can you share the code you’re using for this?

<!DOCTYPE html>
<html lang="en">
<Preformatted texthead>
	<meta charset="utf-8">
	<title>Livewire Project</title>
  @livewireStyles

</head>
<body>

   {{$slot}}

 @livewireScripts

</body>
</html>
<body>
<main>
   {{$slot}}
</main>
 @livewireScripts

</body>

I did it that way, but it still has the same problem. the problem comes from the path of livewire.js. but I don't know how to fix it GET [http://localhost/vendor/livewire/livewire.js?id=d9e06c155e467adb5de2 ](http://localhost/vendor/livewire/livewire.js?id=d9e06c155e467adb5de2) net::ERR_ABORTED 404 (Not Found)

do you publish the config file for livewire?
Have you read the installation doc…and Configuring The Asset Base URL…there is some issues scenarios you need be clear first

| Class Namespace
|--------------------------------------------------------------------------
|
| This value sets the root namespace for Livewire component classes in
| your application. This value affects component auto-discovery and
| any Livewire file helper commands, like artisan make:livewire.
|
| After changing this item, run: php artisan livewire:discover.
|
*/

'class_namespace' => 'App\\Http\\Livewire',

/*
|--------------------------------------------------------------------------
| View Path
|--------------------------------------------------------------------------
|
| This value sets the path for Livewire component views. This affects
| file manipulation helper commands like `artisan make:livewire`.
|
*/

'view_path' => resource_path('views/livewire'),

/*
|--------------------------------------------------------------------------
| Layout
|--------------------------------------------------------------------------
| The default layout view that will be used when rendering a component via
| Route::get('/some-endpoint', SomeComponent::class);. In this case the
| the view returned by SomeComponent will be wrapped in "layouts.app"
|
*/
'layout' => 'layouts.app',

/*
|--------------------------------------------------------------------------
| 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' =>  env('APP_URL', 'http://localhost/composer/laravel8livewire/public/vendor/livewire/livewire.js'),

here I changed the road, but it still doesn’t work.

Sincerely I don’t know what else tell you. For any project I use Livewire, installation result the easiest part and any conflict like this I had before. If you can and if this is a fresh project you are trying to do, create a new one, install Livewire like docs said to do or follow some expertise tutorial, or some experimented guy here can guide you to the goal. I’m sorry