Skip to content
Source
Sign inSign up
TanStack/query

MutationFn not getting called on specific Scenario #8221

Send to my agent
ClosedMiltonAkash(GitHub profile, opens in a new tab) opened this issue 3 comments

Describe the bug

This seems a little weird for me too. I observed below when working with tanstack-start

const resp = await mut.mutateAsync(data);

The above is not calling the function. but

 await mut.mutateAsync(data);

is working fine.

Your minimal, reproducible example

I don't have any

Steps to reproduce

  1. Add const resp = before muation

Expected behavior

Function should be called

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

  • OS: Macos
  • browser: ArcBrowser

Tanstack Query adapter

None

TanStack Query version

Lateste

TypeScript version

No response

Additional context

No response

  1. It happens only if the variable resp is not used.

  2. Thank you for filing this issue, but we need more information before looking into this.

    Specifically, a minimal, standalone, runnable reproduction is needed - preferably with codesandbox or stackblitz. If your issue is TypeScript related, prefer a TypeScript playground.

    We'll close this issue for now, but we'll certainly re-open it if there is a proper reproduction.

  3. TkDodo closed this

  4. TkDodo added labelsneeds-info

  5. Tanstack start. Unused variables are not executing. Nothing to do with query I guess. You can close the issue

Sign in to join this conversation.