TS4111: Property 'error' comes from an index signature, so it must be accessed with ['error'].
I am trying to use trpc with AnalogJs, an Angular meta framework and Nx.
We use the @nx/vite builder to build our application.
While development works perfectly, I am running into the following errors when building the application:
The issue stems from the @nx/vite builder analyzing the
.ts
files inside @trpc/client/src
and @trpc/server/src
folders of my node_modules
.
I was wondering why those src
directories and the .ts
files are included and if you are aware of any issues with React, Nx, and Vite?
Thanks already!3 Replies
Sounds like a project config issue, check your tsconfig is excluding node_modules and see if skipLibCheck is the cause. I believe the latter shouldn’t be a problem as they recommend that stays on I think
From what I understand skipLibCheck works by checking
.d.ts
files, not .ts
files. I will check my config and see why the .ts
files from the node_modules
are considered.
Can you help me understand why they are included? I am just curious what the reason for that is
Also, thanks for responding so quickly! And awesome work with tRPC! I am very excited to continue to use itNot really sure what could be going on here, I'm not an expert in bundling and tooling
Your node_modules should definitely not be having any .ts files checked, it smells like a tsconfig problem