Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Module not found: Can't resolve '@trpc/react-query/rsc' #2064

Open
mmikhan opened this issue Feb 27, 2025 · 0 comments
Open

bug: Module not found: Can't resolve '@trpc/react-query/rsc' #2064

mmikhan opened this issue Feb 27, 2025 · 0 comments

Comments

@mmikhan
Copy link

mmikhan commented Feb 27, 2025

Provide environment information

System:

  • OS: macOS 15.3.1
  • CPU: (8) arm64 Apple M1 Pro
  • Memory: 63.28 MB / 16.00 GB
  • Shell: 5.9 - /bin/zsh

Binaries:

  • Node: 23.4.0 - /opt/homebrew/bin/node
  • Yarn: 1.22.22 - /opt/homebrew/bin/yarn
  • npm: 10.9.2 - /opt/homebrew/bin/npm
  • pnpm: 9.15.0 - /opt/homebrew/bin/pnpm
  • bun: 1.2.2 - /opt/homebrew/bin/bun
{
  "name": "tt",
  "version": "0.1.0",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "next build",
    "check": "next lint && tsc --noEmit",
    "db:generate": "drizzle-kit generate",
    "db:migrate": "drizzle-kit migrate",
    "db:push": "drizzle-kit push",
    "db:studio": "drizzle-kit studio",
    "dev": "next dev --turbo",
    "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
    "format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
    "lint": "next lint",
    "lint:fix": "next lint --fix",
    "preview": "next build && next start",
    "start": "next start",
    "typecheck": "tsc --noEmit"
  },
  "dependencies": {
    "@auth/drizzle-adapter": "^1.7.4",
    "@t3-oss/env-nextjs": "^0.12.0",
    "@tanstack/react-query": "^5.66.9",
    "@trpc/client": "^10.45.2",
    "@trpc/react-query": "^10.45.2",
    "@trpc/server": "^10.45.2",
    "drizzle-orm": "^0.40.0",
    "geist": "^1.3.1",
    "next": "^15.2.0",
    "next-auth": "4.24.11",
    "postgres": "^3.4.5",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "server-only": "^0.0.1",
    "superjson": "^2.2.2",
    "zod": "^3.24.2"
  },
  "devDependencies": {
    "@tailwindcss/postcss": "^4.0.9",
    "@types/eslint": "^9.6.1",
    "@types/node": "^22.13.5",
    "@types/react": "^19.0.10",
    "@types/react-dom": "^19.0.4",
    "@typescript-eslint/eslint-plugin": "^8.25.0",
    "@typescript-eslint/parser": "^8.25.0",
    "drizzle-kit": "^0.30.5",
    "eslint": "^9.21.0",
    "eslint-config-next": "^15.2.0",
    "eslint-plugin-drizzle": "^0.2.3",
    "postcss": "^8.5.3",
    "prettier": "^3.5.2",
    "prettier-plugin-tailwindcss": "^0.6.11",
    "tailwindcss": "^4.0.9",
    "typescript": "^5.7.3"
  },
  "ct3aMetadata": {
    "initVersion": "7.38.1"
  }
}

Describe the bug

The following errors occur after updating the dependencies to the latest version in a fresh T3 scaffolded app:

 ⨯ ./src/trpc/server.ts:3:1
Module not found: Can't resolve '@trpc/react-query/rsc'
  1 | import "server-only";
  2 |
> 3 | import { createHydrationHelpers } from "@trpc/react-query/rsc";
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4 | import { headers } from "next/headers";
  5 | import { cache } from "react";
  6 |



https://nextjs.org/docs/messages/module-not-found



./node_modules/@trpc/react-query/dist/createHooksInternal-063195fc.mjs:4:1
Export hashQueryKey doesn't exist in target module
  2 | import { g as getArrayQueryKey } from './getArrayQueryKey-86134f8b.mjs';
  3 | import { createTRPCClientProxy, createTRPCClient } from '@trpc/client';
> 4 | import { useQuery, useQueryClient, useMutation, hashQueryKey, useInfiniteQuery, useQueries } from '@tanstack/react-query';
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  5 | import React, { createContext, useMemo, useState, useEffect, useCallback, useRef } from 'react';
  6 |
  7 | /**

The export hashQueryKey was not found in module [project]/node_modules/@tanstack/react-query/build/modern/index.js [app-client] (ecmascript) <exports>.
Did you mean to import hashKey?
All exports of the module are statically known (It doesn't have dynamic exports). So it's known statically that the requested export doesn't exist.



./node_modules/@trpc/react-query/dist/createHooksInternal-063195fc.mjs:4:1
Export hashQueryKey doesn't exist in target module
  2 | import { g as getArrayQueryKey } from './getArrayQueryKey-86134f8b.mjs';
  3 | import { createTRPCClientProxy, createTRPCClient } from '@trpc/client';
> 4 | import { useQuery, useQueryClient, useMutation, hashQueryKey, useInfiniteQuery, useQueries } from '@tanstack/react-query';
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  5 | import React, { createContext, useMemo, useState, useEffect, useCallback, useRef } from 'react';
  6 |
  7 | /**

The export hashQueryKey was not found in module [project]/node_modules/@tanstack/react-query/build/modern/index.js [app-ssr] (ecmascript) <exports>.
Did you mean to import hashKey?
All exports of the module are statically known (It doesn't have dynamic exports). So it's known statically that the requested export doesn't exist.


 GET / 500 in 33ms

Reproduction repo

https://github.com/mmikhan/tt

To reproduce

  • Scaffold a new T3 app with Postgres, Next Auth, Drizzle, App router using Bun.
  • Run bun update --latest to update all the dependencies
  • Run bun dev

Visit the homepage and see the errors

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant