From a90f5eb8539dc0af326cffa0bff8d9e29b062162 Mon Sep 17 00:00:00 2001 From: "SALVADOR, 1 M. LIGAYAO" <89230263+itsmenewbie03@users.noreply.github.com> Date: Sat, 17 Sep 2022 12:30:35 +0800 Subject: [PATCH] fix: add missing import in index.ts (#188) * added missing import in index.ts * commit changes suggested by LuanRT Co-authored-by: LuanRT * removed extra require Co-authored-by: Salvador Ligayao Co-authored-by: LuanRT --- index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.ts b/index.ts index 4c8dc91f..2ecfbcab 100644 --- a/index.ts +++ b/index.ts @@ -10,6 +10,11 @@ if (getRuntime() === 'node') { Reflect.set(globalThis, 'Response', undici.Response); Reflect.set(globalThis, 'FormData', undici.FormData); Reflect.set(globalThis, 'File', undici.File); + try { + // eslint-disable-next-line + const { ReadableStream } = require('node:stream/web'); + Reflect.set(globalThis, 'ReadableStream', ReadableStream); + } catch { /* do nothing */ } } import Innertube from './src/Innertube';