Skip to content

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

@schananas

Description

@schananas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions