Skip to content
Source
Sign inSign up
TanStack/query

TypeScript error in /app/node_modules/@tanstack/react-query-devtools/build/lib/utils.d.ts(40,78): #4487

Send to my agent
ClosedElwazer007(GitHub profile, opens in a new tab) opened this issue 3 comments

Describe the bug

Integrating the react-query devtools with react-query is broken , I followed the instructions in the docs : here's a sample code

const Application = () => {

  const queryClient = new QueryClient({
    defaultOptions: {
      queries: {
        refetchOnWindowFocus: false,
        refetchOnMount: false,
      },
    },
  });

  return (
      <QueryClientProvider client={queryClient}>
        {/* My components tree */ }
        <ReactQueryDevtools initialIsOpen={false} />
      </QueryClientProvider>
  );
};

results : Failed to compile the application with the following log error :

    38 |  * Example given `border` and `right` it return `borderRight`
    39 |  */
  > 40 | export declare function getSidedProp<T extends string>(prop: T, side: Side): `${T}Left` | `${T}Right` | `${T}Bottom` | `${T}Top`;
       |                                                                              ^
    41 | export interface SidePanelStyleOptions {
    42 |     /**
    43 |      * Position of the panel
Compiling...
Failed to compile.

Your minimal, reproducible example

asked in stackoverflow https://stackoverflow.com/questions/74362928/react-query-devtools-doesnt-in-a-react-typescript-app

Steps to reproduce

install react query version 4.0.10 install react query devtools 4.14.5 configure react query devtools just as docs description

Expected behavior

I think it shloud be working as normal but it is failing to compile

How often does this bug happen?

No response

Screenshots or Videos

Screenshot 2022-11-08 at 5 24 41 PM

Platform

macos m1 chrome browser

react-query version

4.0.10

TypeScript version

3.7.5

Additional context

react-query-devtools version is 4.14.5

  1. Please show a real running reproduction of the issue in either codesandbox or stackblitz.

  2. TkDodo added labelsneeds-info

  3. TkDodo added labelspackage: react-query-devtools

  4. I've encountered similar issue, but (in my case) it happened because of the confusion with react-query vs @tanstack/react-query. Maybe they have to be also on the same version?

    Any way, my Sandbox with working devtools: react-query-simple-devtools-usage

  5. I just saw:

    TypeScript version 3.7.5

    Please note that TanStack/query v4 requires at least TypeScript 4.1:

    template literal types are only supported in TS 4.1 or greater

  6. TkDodo closed this

  7. TkDodo removed labelsneeds-info

  8. TkDodo added labelstypes

  9. TkDodo added labelsworks as designed

Sign in to join this conversation.