Skip to content

Commit

Permalink
[node] fix: stream depends on global Blob not available in v16
Browse files Browse the repository at this point in the history
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 DefinitelyTyped#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 12, 2022
1 parent ae199c4 commit d9ac31c
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 d9ac31c

Please sign in to comment.