Skip to content
Source
Sign inSign up
TanStack/query

Failed to compile : You may need an appropriate loader to handle this file type. #7821

Send to my agent
ClosedMasum00x(GitHub profile, opens in a new tab) opened this issue 1 comment

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

  1. it seems your bundler can't handle nullish coalesce:

    https://tanstack.com/query/v5/docs/framework/react/installation#requirements

  2. TkDodo closed this

  3. TkDodo added labelswontfix

  4. TkDodo added labelsworks as designed

Sign in to join this conversation.