Describe the bug#
Failed to compile.
Module parse failed: Unexpected token (11:23)
You may need an appropriate loader to handle this file type.
| }
| function canFetch(networkMode) {
> return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
| }
| var CancelledError = class {
Your minimal, reproducible example#
..
Steps to reproduce#
By just only importing the
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
I have encountered this error in 5.51.15 version.
Expected behavior#
It should run without any error.
How often does this bug happen?#
None
Screenshots or Videos#
No response
Platform#
- OS [Ubuntu 22.04]
- node 22.5.1
- npm 10.8.2
Tanstack Query adapter#
react-query
TanStack Query version#
5.51.15
TypeScript version#
No response
Additional context#
No response
it seems your bundler can't handle nullish coalesce:
https://tanstack.com/query/v5/docs/framework/react/installation#requirements