lazy loading does not work, but direct import works
minimal example:
not working:
however, replacing lazy with
core: jobCoreRouter,
and a direct import works...
working:
this is how the jobCoreRouter looks:
5 Replies
here is my tsconfig for extra measure, in case it's to do with the lazy import (doesn't reference .ts or .js)
also i'm on 11.1.2 (matching for all trpc packages)
how are you calling it? might be a bug in our react adapter, i see your code mentions RSC
here's a working reference
https://github.com/trpc/trpc/tree/main/examples/lazy-load
if you can, make a reproduction and post an issue on github using one of our example projects
@Alex / KATT 🐱
http://localhost:3000/api/trpc/jobs.core.queries.getJobDetails
the fact that direct import works and lazy doesn't, i assume it might be related to the adapter.
how are you setting up the client?
client.ts:
also a typical provider.tsx with queryClient + superjson.
like mentioned, it's working until i use
lazy
and point to the same import 😄