Industrial
Industrial16mo ago

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

import { createServerSideHelpers } from '@trpc/react-query/server'
import { createServerSideHelpers } from '@trpc/react-query/server'
This should work, right?
10 Replies
Nick
Nick16mo ago
Where did you get that from? Should be @trpc/server
Industrial
Industrial16mo ago
GitHub
trpc/index.ts at 04fa9d04420e677f3a8e46d3868169321eb5dcc8 · trpc/trpc
🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/index.ts at 04fa9d04420e677f3a8e46d3868169321eb5dcc8 · trpc/trpc
Nick
Nick16mo ago
Ah maybe I'm getting mixed up then 😄 What's in your package.json?
Industrial
Industrial16mo ago
actually, it's described here: https://trpc.io/docs/nextjs/ssg
Static Site Generation | tRPC
Reference project//github.com/trpc/examples-next-prisma-todomvc
Industrial
Industrial16mo ago
{
"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"
}
}
Nick
Nick16mo ago
You might need to update your tRPC version
Nick
Nick16mo ago
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
GitHub
trpc/package.json at 8ec386ff118020356d39c8796b7bb68666abfe4c · trp...
🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/package.json at 8ec386ff118020356d39c8796b7bb68666abfe4c · trpc/trpc
Nick
Nick16mo ago
GitHub
trpc/package.json at 04fa9d04420e677f3a8e46d3868169321eb5dcc8 · trp...
🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/package.json at 04fa9d04420e677f3a8e46d3868169321eb5dcc8 · trpc/trpc
Nick
Nick16mo ago
server was added recently 🙂
Industrial
Industrial16mo ago
Updated the packages and now it works. Thanks!