You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #7587 on June 18, 2024 12:50.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Hello, please tell me what is my mistake(((.
Your minimal, reproducible example
"@tanstack/react-query
Steps to reproduce
#############################main.tsx:
import { RouterProvider, createRouter } from "@tanstack/react-router";
import React from 'react';
import ReactDOM from 'react-dom/client';
import { routeTree } from './routeTree.gen'
import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
import App from "./App";
const router = createRouter({ routeTree })
declare module '@tanstack/react-router' {
interface Register {
router: typeof router;
}
}
// create a client
const queryClient = new QueryClient();
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
</React.StrictMode>,
);
########################index.lazy.tsx:
import { createLazyFileRoute } from "@tanstack/react-router";
import AddPost from "../../components/AddPost";
import { useQuery } from "@tanstack/react-query";
import { fetchPosts } from "../../api/posts";
export const Route = createLazyFileRoute('/post/')({
component: PostIndex,
});
function PostIndex(){
return
PostIndex
###############posts.tsx
export async function fetchPosts(){
const response = await fetch('http://localhost:3000/posts');
return response.json()
}
##################vite.config.ts:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { TanStackRouterVite } from '@tanstack/router-vite-plugin'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), TanStackRouterVite()],
})
Expected behavior
i tried to delete this issue with npm i, nut this no help me.
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
WIndows
Tanstack Query adapter
None
TanStack Query version
5.45.1
TypeScript version
No response
Additional context
(vitejs.dev, Tanstack Router, Tanstack React Query, TS). I try to make with TS this tutorial. but ich have this issue after 16:50m: https://www.youtube.com/watch?v=AAMBoENvfnE&t=998s:
Beta Was this translation helpful? Give feedback.
All reactions