Nomad
Weird data type when extending context in fetch adapter
Environment:
* pnpm
* Vite react SPA
* Node v22.11.0
* tRPC server and client version: 11.0.0-rc.828
* Using tRPC with tanstack query (and the new integration approach)
I realise that "weird" is a really bad descriptor, but I honestly don't know what else to call it.
I'm using the fetch adapter with CF workers and needed cloudflare's env in my context, I added this like such:
Now this works wonders, I get access to the cloudflare env in my procedures via context and can use KV bindings from there, very nice! Unfortunately the type from the client is very odd, specifically it considers the data from my query to be of type:
(() => never) | undefined
As in the following:
Now, this purely from a type pespective, the actual value is there during runtime and works fine. But obviously as soon as the code gets type checked it throws a fit because it thinks I'm trying ot access val
on that type.
Any help is greatly appreciated!36 replies