F
Filament15mo ago
HyMaMa

The GET method is not supported for route livewire/update

Hello! I am not familiar with Filament. Just installed it for test, open in browser /admin page and catche a problem, that I can't resolve. Php 8.2, Laravel 10 Filament 3 https://flareapp.io/share/DPydlGRm any thoughts?
Flare
The GET method is not supported for route livewire/update. Supported methods: POST. - The error occurred at https://ebcd.ru/livewire/update/
Solution:
solved. Problem was in nginx rule
Jump to solution
13 Replies
awcodes
awcodes15mo ago
sounds like you might have missed a step in the install. or you possibly have conflicting versions of Livewire installed somehow.
HyMaMa
HyMaMaOP15mo ago
livewire was installed with filaments requirements. I had done all steps in this page https://filamentphp.com/docs/3.x/panels/installation
awcodes
awcodes15mo ago
try this: remove '-stable' in composer.json for filament then run composer update
HyMaMa
HyMaMaOP15mo ago
no luck. Just understood, that on localhost all works well
awcodes
awcodes15mo ago
if that's the case then something is off in your production server config. it's proabably trying to server livewire.js as a static assets instead of letting laravel serve it through php.
Solution
HyMaMa
HyMaMa15mo ago
solved. Problem was in nginx rule
HyMaMa
HyMaMaOP15mo ago
rewrite ^([^.]*[^/])$ $1/ permanent; Now I am searching how to solve rewrite rule and using filament
awcodes
awcodes15mo ago
location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ^~ /filament {
try_files $uri $uri/ /index.php?$query_string;
}

location ^~ /livewire {
try_files $uri $uri/ /index.php?$query_string;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ^~ /filament {
try_files $uri $uri/ /index.php?$query_string;
}

location ^~ /livewire {
try_files $uri $uri/ /index.php?$query_string;
}
keithjk
keithjk15mo ago
I am still getting this error in some places on a new app, but the rewrites you provided @awcodes haven't solved. any other thoughts about what might be causing such an issue? https://flareapp.io/share/v5pnEdlP
Flare
The GET method is not supported for route livewire/update. Supported methods: POST. - The error occurred at http://base.deliverables.io/livewire/update
awcodes
awcodes15mo ago
Not sure sorry. Maybe ask in the livewire discord since it’s not directly related to filament. Might get a better answer there.
keithjk
keithjk15mo ago
the thing is, it's only a very few select spots, it's not happening universally?
Iztok
Iztok15mo ago
I've found out that if I have a Livewire function that deletes a model this would happen. Just to give an example, when changing the model to have SoftDeletes, the 404 error was gone.
keithjk
keithjk15mo ago
mine is occurring when trying to do an AttachAction on a relation manager with pivot data, within the pivot data is a belongsToMany. i get the error the first time, but it saves the Attach base record without the pivot data; then i edit the relation, and it saves the pivot belongsToMany, but it throws the error and you only see that it actually saved once you refresh the page.
Want results from more Discord servers?
Add your server