EvanE
tRPC17mo ago
5 replies
Evan

TSC errors after upgrading to v11

Hello, I am trying to upgrade to v11 and encountering the following error:

tsc --declaration --emitDeclarationOnly


added 249 packages, and audited 523 packages in 3s

40 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.d.ts:6:22 - error TS2304: Cannot find name 'ReadableStreamDefaultReader'.

6     getReader: () => ReadableStreamDefaultReader<Uint8Array>;
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.d.ts:82:69 - error TS2315: Type 'ReadableStream' is not generic.

82 export declare function jsonlStreamProducer(opts: ProducerOptions): ReadableStream<Uint8Array>;
                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.d.ts:103:21 - error TS2304: Cannot find name 'ReadableStreamDefaultController'.

103         controller: ReadableStreamDefaultController<ChunkData | StreamInterruptedError>;
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/sse.d.ts:45:76 - error TS2315: Type 'ReadableStream' is not generic.

45 export declare function sseStreamProducer(opts: SSEStreamProducerOptions): ReadableStream<string>;
                                                                              ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/sse.d.ts:57:11 - error TS2304: Cannot find name 'EventSource'.

57     from: EventSource;
             ~~~~~~~~~~~


Found 5 errors in 2 files.

Errors  Files
     3  node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.d.ts:6
     2  node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/sse.d.ts:45
Solution
fixed by adding the "DOM" lib to my TS config
Was this page helpful?