zirkelcZ
tRPC3y ago
11 replies
zirkelc

TypeScript Alias Imports don't get resolved ont the Client

I have a Monorepo with a multiple /packages/* packages, each has its own tsconfig.json. I noticed that I get type errors on the client side if I use TypeScript alias path imports on the server package. The alias import paths for the server are only defined in the server/tsconfig.json and not in the client/tsconfig.json.

If I change the alias imports on the server side to relative imports, it works on the client. It seems like TypeScript cannot follow the imports correctly from client to server, because it doesn't check the server tsconfig.

Anyone the same issue?
Was this page helpful?