Alfonso GuerraA
tRPCβ€’6mo agoβ€’
1 reply
Alfonso Guerra

Migrating v11 from classic client to TanStack Query: β€œError: experimental_prefetchInRender feature ”

My code was working using the classic React client, but the shiny new feature set promised virility and good looks. But when I call useQuery() on my API, it's returning a rejected promise with the error message "Error: experimental_prefetchInRender feature flag is not enabled". Why does it think I requested a prefetch, and how do I correct the code so it doesn't request a prefetch?

I asked Copilot and got this response:



which is contrary to the instructions on https://trpc.io/docs/client/tanstack-react-query/migrating.

I got a similar response from Amazon Q:

I need to know why TQ thinks I'm trying to do a prefetch, and how to correct my code so it doesn't get rejected anymore.

Many thanks in advance πŸ™
copilot-prefetchInRender.png
Screen_Shot_2025-07-19_at_06.57.32.png
Was this page helpful?