TanStackT
TanStack9mo ago
3 replies
standard-azure

Solidstart + TanStack/query error prefetch

Hello, I'm writing here because I have a problem with TanstackQuery. I tried to implement it in my Solidstart project. But I get this error every time:
 (index):347 Uncaught (in promise) Error: experimental_prefetchInRender feature flag is not enabled


Here is an example of my implementation :
export default function Home() {
  const query = useQuery(() => ({
    queryKey: ["title"],
    queryFn: async () => {
      const res = await fetch(import.meta.env.VITE_API_URL);
      if(!res.ok) throw new Error("Failed to fetch data");
      return res.text();
    }
  }))
  return (
    <p>{query.data}</p>
  )
}


Anyone know if the problem has been solved?
Was this page helpful?