Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tRPC returns result on client but never called on backend #183

Open
schananas opened this issue Oct 28, 2024 · 2 comments
Open

tRPC returns result on client but never called on backend #183

schananas opened this issue Oct 28, 2024 · 2 comments

Comments

@schananas
Copy link

I just met the craziest issue I have seen and it all points to tRPC Nuxt. (trpc-nuxt: 0.10.21)

Im posting here in hope to understand what happen. Everything started happening after upgrade of the Nuxt and some other dependencies.

I have two onboarding components Step1.vue and Step2.vue

Step1.vue calls:

      await updateUserMutation.mutate({
        name,
      });

This method returns valid result on client site, but backend is actually never called!

Then:

Step2.vue calls:

    await createTeamMutation.mutate({
      name: teamName,
    });

createTeamMutation which is completely different RPC, actually invokes updateUserMutation backend and returns user result instead of team result.

I tried renaming createTeamMutation name to something else in hope it will trigger a recompile, and it worked, but just for a short time, then everything start bugging again. This behavior is reproducible in local dev and in production .

  1. How its even possible that updateUserMutation returns a result without backend being called?
  2. why createTeamMutation actualy invokes updateUserMutation backend?

I have upgraded to 0.10.22, and issue gone away only for initial RPC calls, after that, every next call brings the issue back.

Please help me understand what is going on.

@wobsoriano
Copy link
Owner

Would you be able to create a minimal reproduction I can play with?

@schananas
Copy link
Author

Il check, it's part of larger application...
If it helps I managed to mitigate the bug by adding clearNuxtData() before both method calls on the client.
Does it ring a bell?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants