Server action results in 404 status code in browser console
Answered
Transvaal lion posted this in #help-forum
Transvaal lionOP
Hi,
I created a next server action and called it in client component. However, it does not resolve and the browser console shows that the request ends up getting a 404 from the server.
Other server actions defined before work. The only difference between those and the one created now is that they were called from a client component that lived in a server component page.
Now I wonder whether for server actions to work they are required to be called from server component pages?
I couldnt find anything like that in the docs so far.
I'm on latest next btw
I created a next server action and called it in client component. However, it does not resolve and the browser console shows that the request ends up getting a 404 from the server.
Other server actions defined before work. The only difference between those and the one created now is that they were called from a client component that lived in a server component page.
Now I wonder whether for server actions to work they are required to be called from server component pages?
I couldnt find anything like that in the docs so far.
I'm on latest next btw
Answered by Transvaal lion
Oh my god
It was due to me using clerks
It was due to me using clerks
auth.protect()
which returns a 404 when unauthorized 🤦1 Reply
Transvaal lionOP
Oh my god
It was due to me using clerks
It was due to me using clerks
auth.protect()
which returns a 404 when unauthorized 🤦Answer