-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
⏮ needs reproductionHelp us help you - make a failing testHelp us help you - make a failing test🐛 bug: unconfirmed
Description
Provide environment information
System:
OS: macOS 15.6.1
CPU: (12) arm64 Apple M4 Pro
Memory: 348.33 MB / 24.00 GB
Shell: 4.1.2 - /opt/homebrew/bin/fish
Binaries:
Node: 24.0.1 - /Users/karan/.local/share/mise/installs/node/24.0.1/bin/node
npm: 11.3.0 - /Users/karan/.local/share/mise/installs/node/24.0.1/bin/npm
pnpm: 10.16.1 - /Users/karan/.local/share/mise/installs/node/24.0.1/bin/pnpm
bun: 1.2.21 - /Users/karan/.local/share/mise/installs/bun/1.2.21/bin/bun
Browsers:
Chrome: 142.0.7444.60
Safari: 18.6
npmPackages:
typescript: ~5.8.3 => 5.8.3
Describe the bug
We're using ZenStack's TRPC plugin to automatically generate TRPC router for Prisma models. Some of our models have JSON fields, which Prisma types as Prisma.JsonValue.
The issue we seem to be facing is, over the network boundary, when TRPC tries to infer the return types of these auto-generated procedures on the client side, it can't correctly infer the Prisma.JsonValue, as it doesn't Serialize well, and since it's recursive, it gets infinitely deep.
Link to reproduction
N/A
To reproduce
- Write a procedure that returns an object of type
Prisma.JsonValue. - Try to use the router type to create a client.
- Call the procedure on the client, accessing the return value. TypeScript is unable to properly type the object, and we get the above mentioned error.
Additional information
N/A
👨👧👦 Contributing
- 🙋♂️ Yes, I'd be down to file a PR fixing this bug!
Metadata
Metadata
Assignees
Labels
⏮ needs reproductionHelp us help you - make a failing testHelp us help you - make a failing test🐛 bug: unconfirmed