useMutation weird issue with server actions
guys, weird question but before some days, some mutations stopped working locally (not sure why it hasn't happend before).
I am a bit confused as to why this example doesn't fire the server action (a file that export loginAction and is marked with 'use server' (I don't like it too Tanner π ))
While doing this works
4 Replies
adverse-sapphireβ’4w ago
We now pass the context as second argument and i guess that's not serializable
adverse-sapphireOPβ’4w ago
So, is the second approach the only solution? I donβt want to go through the whole codebase and do the latter by typing every value
adverse-sapphireβ’4w ago
mutationFn is now (values, context) => Promise
if you write this mutationFn: loginAction, it sends both params to the serverAction I presume, and next doesn't like that I guess. what error are you even getting?adverse-sapphireOPβ’4w ago
No errors at all, loginAction never fires
This doesn't happen with a project started from scratch so I am assuming it's either an issue with next 14 or some configuration issue.
For now, I think im going to modify every action with the second approach to not pass the context.