foantje's avatar

livewire 404 update problem

I updated from livewire 2 -> 3.

But i have a problem with livewire:update getting a 404

I have a simple component with 2 function to increase or decrease a number with wire:click. But when i click the button it opens a modal with 404 page. In my console it shows livewire:update 404.

If i dd('test') on the mount() i do see the result...

In the config i changed this: 'layout' => 'layouts.app', because i have there my app.blade.php (resources/views/layouts/app.blade.php

Also i turned on 'inject_assets' => true, and removed the livewirestyles and scripts i check pagesource and see that it is being injected.

Any advice...?

0 likes
4 replies
colbyalbo's avatar

FYI - that configuration change - 'layout' => 'layouts.app' , is for full page components

Sounds like the button is trying to access a route, and cant find it or cant find a bound parameter that is passed with it. Hard to say with seeing some of the relevant code

foantje's avatar

@colbyalbo No is when it tries to go to livewire:update that it is giving a 404. I can show my code but i haven't changed anything on that because it worked before.

Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:8000/livewire/update

Update:

I debugged a bit more and made a simple livewire component to test. I noticed on my admin section it worked but not on frontend. Then i looked at my routes if i place it outside my frontend group livewire works...

So i'm guessing it has something to do with the prefix ?

 if (in_array(\Request::segment(1), \Config::get('app.alt_langs'))) {
        \App::setLocale(\Request::segment(1));
        Config::set('app.locale_prefix', \Request::segment(1));
    }

    /*** FRONTEND ***/
    Route::group(['prefix' => \Config::get('app.locale_prefix')], function () {
 Route::get('/blog/{blog:slug}', [FrontendController::class, 'blogDetail'])->name('blogdetail');
}
tomcastillo's avatar

Thanks for your suggestion. This is what I'm looking for.

Please or to participate in this conversation.