Skip to content

Commit

Permalink
🤖 Merge PR #62672 [node] fix: stream depends on global Blob not avail…
Browse files Browse the repository at this point in the history
…able in v16 by @meyfa

Blob is only available on the global object starting in Node 18. Still,
the `stream` definitions used the global Blob. This means that
`@types/node` 16.x is currently broken. This patch adds the correct
import to resolve this problem. For more info please refer to #62654.

Long-term, IMHO we should remove `"lib": ["dom"]` from the v16 TSConfig
like it was already done for v18, but I'd much rather get this fix out
quickly and worry about that later.
  • Loading branch information
meyfa committed Oct 15, 2022
1 parent 2f20bb8 commit 58e66a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions types/node/v16/stream.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
declare module 'stream' {
import { EventEmitter, Abortable } from 'node:events';
import { Blob } from 'node:buffer';
import * as streamPromises from 'node:stream/promises';
import * as streamConsumers from 'node:stream/consumers';
class internal extends EventEmitter {
Expand Down
1 change: 1 addition & 0 deletions types/node/v16/ts4.8/stream.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
declare module 'stream' {
import { EventEmitter, Abortable } from 'node:events';
import { Blob } from 'node:buffer';
import * as streamPromises from 'node:stream/promises';
import * as streamConsumers from 'node:stream/consumers';
class internal extends EventEmitter {
Expand Down

0 comments on commit 58e66a8

Please sign in to comment.