/packages/studio imports /packages/trpc, meaning trpc is built first, studio second. When building trpc alone - it works fine, meanwhile building studio fails on DTS stage, meaning the built JS is alright. the studio's build error says
src/trpc.ts(4,14): error TS2742: The inferred type of 'trpc' cannot be named without a reference to '../../trpc/node_modules/@aws-sdk/client-s3/dist-types'. This is likely not portable. A type annotation is necessary.
src/trpc.ts(5,14): error TS2742: The inferred type of 'trpcClient' cannot be named without a reference to '../../trpc/node_modules/@aws-sdk/client-s3/dist-types'. This is likely not portable. A type annotation is necessary.
my trpc procedures indeed use s3 client and the problem may be the fact that DTS for trpc starts as follows (packages/trpc/dist/index.d.ts)
import * as zod from 'zod';
import * as better_auth from 'better-auth';
import * as express from 'express';
import * as _aws_sdk_client_s3 from '@aws-sdk/client-s3'; // ?
import * as type_fest from 'type-fest';
import * as prisma from 'prisma';
import * as _trpc_server from '@trpc/server';
declare const auth: {
handler: (request: Request) => Promise<Response>;
api: better_auth.InferAPI<{
ok: {
// 100500 locs below...
asset: _trpc_server.TRPCBuiltRouter<{
ctx: object;
meta: object;
errorShape: _trpc_server.TRPCDefaultErrorShape;
transformer: false;
}, _trpc_server.TRPCDecorateCreateRouterOptions<{
upload: _trpc_server.TRPCMutationProcedure<{
input: {
projectId: string;
fileName: string;
data: string;
};
output: _aws_sdk_client_s3.PutObjectCommandOutput; // ?
meta: object;
}>;
imo, how would Studio package know what _aws_sdk_client_s3 is when unlike trpc package, it does not have @aws-sdk/client-s3 installed?