T
tRPC

Cannot find module '@trpc/react-query/server' or its corresponding type declarations

Cannot find module '@trpc/react-query/server' or its corresponding type declarations

IIndustrial4/24/2023
import { createServerSideHelpers } from '@trpc/react-query/server'
import { createServerSideHelpers } from '@trpc/react-query/server'
This should work, right?
Nnlucas4/24/2023
Where did you get that from? Should be @trpc/server
Nnlucas4/24/2023
Ah maybe I'm getting mixed up then 😄 What's in your package.json?
IIndustrial4/24/2023
actually, it's described here: https://trpc.io/docs/nextjs/ssg
{
"private": true,
"name": "@code9/todo-web",
"version": "0.1.0",
"description": "",
"main": "index.js",
"keywords": [],
"author": "",
"license": "ISC",
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "pnpm lint:tsc && pnpm lint:eslint",
"lint:eslint": "eslint --fix --cache .",
"lint:tsc": "tsc -p . --noEmit",
"pre-commit": "lint-staged",
"start": "next start"
},
"lint-staged": {
"*.{js,mjs,cjs,jsx,ts,tsx,json}": "pnpm lint"
},
"dependencies": {
"@emotion/cache": "^11.10.5",
"@emotion/css": "^11.10.6",
"@emotion/react": "^11.10.6",
"@emotion/server": "^11.10.0",
"@emotion/styled": "^11.10.6",
"@fontsource/roboto": "^4.5.8",
"@mui/icons-material": "^5.11.16",
"@mui/material": "^5.11.16",
"@tanstack/react-query": "^4.18.0",
"@trpc/client": "^10.18.0",
"@trpc/next": "^10.18.0",
"@trpc/react-query": "^10.18.0",
"@trpc/server": "^10.18.0",
"clsx": "^1.1.1",
"next": "^13.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-query": "^3.39.3",
"superjson": "^1.7.4",
"zod": "^3.0.0"
},
"devDependencies": {
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"lint-staged": "^13.2.1",
"tsx": "^3.12.3",
"typescript": "^4.8.3"
}
}
{
"private": true,
"name": "@code9/todo-web",
"version": "0.1.0",
"description": "",
"main": "index.js",
"keywords": [],
"author": "",
"license": "ISC",
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "pnpm lint:tsc && pnpm lint:eslint",
"lint:eslint": "eslint --fix --cache .",
"lint:tsc": "tsc -p . --noEmit",
"pre-commit": "lint-staged",
"start": "next start"
},
"lint-staged": {
"*.{js,mjs,cjs,jsx,ts,tsx,json}": "pnpm lint"
},
"dependencies": {
"@emotion/cache": "^11.10.5",
"@emotion/css": "^11.10.6",
"@emotion/react": "^11.10.6",
"@emotion/server": "^11.10.0",
"@emotion/styled": "^11.10.6",
"@fontsource/roboto": "^4.5.8",
"@mui/icons-material": "^5.11.16",
"@mui/material": "^5.11.16",
"@tanstack/react-query": "^4.18.0",
"@trpc/client": "^10.18.0",
"@trpc/next": "^10.18.0",
"@trpc/react-query": "^10.18.0",
"@trpc/server": "^10.18.0",
"clsx": "^1.1.1",
"next": "^13.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-query": "^3.39.3",
"superjson": "^1.7.4",
"zod": "^3.0.0"
},
"devDependencies": {
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"lint-staged": "^13.2.1",
"tsx": "^3.12.3",
"typescript": "^4.8.3"
}
}
Nnlucas4/24/2023
You might need to update your tRPC version Obviously package.json isn't necessarily the version you have pinned, but here's 10.18: https://github.com/trpc/trpc/blob/8ec386ff118020356d39c8796b7bb68666abfe4c/packages/react-query/package.json vs latest: https://github.com/trpc/trpc/blob/04fa9d04420e677f3a8e46d3868169321eb5dcc8/packages/react-query/package.json server was added recently 🙂
IIndustrial4/24/2023
Updated the packages and now it works. Thanks!

Looking for more? Join the community!

T
tRPC

Cannot find module '@trpc/react-query/server' or its corresponding type declarations

Join Server
Recommended Posts
Procedure with generic input?Is there a way to define a procedure so that it takes input with type parameters, and returns outputDelete item {0: {json:{id: 12324}}}When i try to mutate/delete item with id i am geting this payload `{0: {json:{id: 12324}}}`, withouQuery function depends on a variableIn tRPC v10 accessing a specific path is really easy, but because of that I don't control the query 'useInfiniteQuery' hook disappeared after moving to TurborepoI am using Turborepo with Next.js with the following layout, originally a T3 app - `/apps/app` - `/pconvert the result to date objectsI am not sure if this is even trpcs responsibility but I would like to get my date objects as date oECONNREFUSED with TRPC call on VercelAnyone run into this before? I just deployed my app to Vercel and I run into this error when I triggInvalid ValDoes TRPC string input have a limit? https://prnt.sc/KlXlyoGrzP8P Edit: It was actually from stripis possible to combine next-minimal-starter with react-router-dom ?Hi, I'm trying to combine https://github.com/trpc/trpc/tree/main/examples/next-minimal-starter and rusing same query for entries appHow to use same query for many components? I don't want to request api for many times ;-; I can't pHow can I make a direct fetch on a router endpoint from TRPC in NextJS on client?In the documentation you can use the vanilla TRPC client like this: ``` const bilbo = await clientHow to get unwrapped errors out of proxy clientI'm using sveltekit and in order to redirect from SSR you need to throw an error: https://kit.sveltCan you get the queryClient without using a hook?Can you get the queryClient without using a hook?How can I reset the cursor when using useInfiniteQuery?I have various filters that I can set for the query, but when setting those filters I need to reset How does routing work in tRPC especially when using merged routers?I am having trouble understanding how tRPC lays out routes. Let's say I have the below ```typescripwhere is useQuery [key]?Learning trpc, i use to tanstack with queryKey, can not find how that works with trpc, if i want tuseInfinieQuery with initialData, Refetch only after second change of inputsHi everyone, I have the problem as stated in the title. My code looks like the following: ```ts Adding tRPC HOC breaks zustandIt seems that adding the trpc hoc breaks my zustand stores initial values and generates bad data. AfNext.js + tRPC, multitenancy, access Next.js Router when setting tRPC headersHey all! I'm writing a multi-tenant solution. Most Next.js pages lie under the `/pages/[tenantKey]/`getInfiniteData returns undefinedI am using the t3-stack. Whenever I am calling getInfiniteData it returns undefined. ``` console.loEnable both `useQuery` and a raw `query` from the frontend (for use in async validation)Hello everyone, some context: ``` . I'm building a project with a variant of the t3 stack (key point