inflearn logo
강의

講義

知識共有

フルスタックリアクトライブコーディング - シンプルなショッピングモールを作る

クライアント環境設定/ルータ処理

query 에러 발생했습니다.

解決済みの質問

538

작성자 없음

投稿した質問数 0

1

스크린샷 2023-09-10 오후 6.58.08.pngUnexpected Application Error!

No QueryClient set, use QueryClientProvider to set one

Error: No QueryClient set, use QueryClientProvider to set one
    at useQueryClient (http://localhost:3000/node_modules/.vite/deps/chunk-PPRRYNMJ.js?v=afce5f27:2826:11)
    at useBaseQuery (http://localhost:3000/node_modules/.vite/deps/chunk-PPRRYNMJ.js?v=afce5f27:3003:23)
    at useQuery (http://localhost:3000/node_modules/.vite/deps/chunk-PPRRYNMJ.js?v=afce5f27:3051:10)
    at ProductList (http://localhost:3000/src/pages/products/index.tsx?t=1694339505145:26:7)
    at renderWithHooks (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:12169:26)
    at mountIndeterminateComponent (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:14919:21)
    at beginWork (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:15900:22)
    at beginWork$1 (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:19747:22)
    at performUnitOfWork (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:19192:20)
    at workLoopSync (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:19131:13)
import { Suspense, useEffect } from "react";
import { getClient } from "./queryClient";
import { QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { routes } from "./routes";
import { useRoutes } from "react-router-dom";

const App = () => {
	const elem = useRoutes(routes);
	const queryClient = getClient();
	console.log("QueryClient:", queryClient); //

	useEffect(() => {
		console.log("QueryClientProvider is mounted.");
	}, []);
	return (
		<QueryClientProvider client={queryClient}>
			<Suspense fallback={<div>Loading...</div>}>{elem}</Suspense>
			<ReactQueryDevtools initialIsOpen={false} />
		</QueryClientProvider>
	);
};
export default App;
import React from "react";

export const DynamicIndex = React.lazy(() => import("./pages/index"));
export const DynamicProductsIndex = React.lazy(() => import("./pages/products/index"));
export const DynamicProductsId = React.lazy(() => import("./pages/products/[id]"));
import GlobalLayout from "./pages/_layout";
import * as Lazy from "./Lazy";

export const routes = [
	{
		path: "/",
		element: <GlobalLayout />,
		children: [
			{ path: "/", element: <Lazy.DynamicIndex />, index: true },
			{ path: "/products", element: <Lazy.DynamicProductsIndex />, index: true },
			{ path: "/products/:id", element: <Lazy.DynamicProductsId /> },
		],
	},
];

export const pages = [{ route: "/" }, { route: "/products" }, { route: "/products/:id" }];

queryclient와 queryprovider를 잘 설정한것 같은데 에러가 발생하고 있습니다. 거의 4시간 가까이 찾아본것 같습니다.. Lazy부분은 따로 분리를 안하면 경고를 띄워서 분리를 했습니다. 이리저리 만져서 tool도 안뜨는걸 뜨게 했는데 저 에러는 도저히 해결이 안되네요 ... 스크린샷 2023-09-10 오후 7.02.20.pnghttps://github.com/littleduck1219/Web_Toy_Project/tree/main/shopping-mall

 

 

react firebase graphql

回答 1

0

jaenam

react-router 버전 6로 설치하셨네요. 해당 버전에 대한 대응이 필요해 보입니다.

https://reactrouter.com/en/main/start/overview

장바구니 담기 버튼 누르면 404에러가 뜹니다

0

253

1

[useRoutes, React-Query 오류 해결방법] No QueryClient set, use QueryClientProvider to set one 에러 나시는 분 보세요 !!!

4

1210

2

깃허브에서 선생님께서 올리신 파일 받아,, 실행시켜보려했으나 안됩니다

0

343

1

상품목록페이지만들기에서 ... 막힙니다..

0

407

1

강의 시점과 지금시점이 꽤 달라진게 있는거 같아요

0

500

1

상품목록 불러오기, 장바구니 삭제 에러 질문 드립니다

0

411

1

graphqlFetcher 관련 에러와 , data 객체 정의 되지 않는 오류 질문 드립니다

0

572

2

productdetail 데이터 안불러와지고 있습니다.

1

445

1

react typescript vite 설치시 오류 질문드립니다.

0

1794

2

섹션1의 1강 routes.tsx에서 에러가 발생합니다

0

813

2

routes.tsx에서 질문이 있습니다!

1

576

1

vite-plugin-next-react-router

0

1475

3

grahpqlFetcher 설명가능할까요

1

501

1

msw mocking enabled

1

789

2

[기술 질문아님]

0

551

2

products 라우팅은 되는데 cart 라우팅은 안되네요 ㅠ

0

584

2

caught Error: No QueryClient set, use ueryClientProvider 에러

13

1970

3

Heroku build관련 오류가 발생해 글 남깁니다 ㅠㅠ

0

705

1

firebase filterling 관련 질문

0

568

3

body가 json 형태가 아닌 ReadableStream 형태로 찍힙니다.

0

785

1

graphqlFetcher 관련 에러가 해결이 안됩니다. ㅠㅠ

1

673

3

MSW graphqlFetcher 에러 관련

0

477

1

graphql-tag, graphql-request 패키지를 사용하는 이유가 궁금합니다.

0

790

1

1일차 fetch api 진행 시 CORS 에러

0

1046

2