T
TanStack5mo ago
noble-gold

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
 (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>
)
}
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?
1 Reply
fascinating-indigo
fascinating-indigo3mo ago
I'm getting the same error when trying tanstack/start + tanstack/query https://github.com/allangalera/lastwar-helper

Did you find this page helpful?