tRPCttRPC
Powered by
EvanE
tRPC•2y 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
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
Jump to solution
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Upgrading from v10 to v11
typedefTtypedef / ❓-help
9mo ago
Upgrading tRPC v10 to v11 in NextJS 15.0.1
AdicssAAdicss / ❓-help
12mo ago
Types issues upgrading to v11, `never` when using t.router
mhMmh / ❓-help
16mo ago
When upgrading to v11, the AppRouter in .d.ts is any
YamakasingeYYamakasinge / ❓-help
10mo ago