Skip to content

Commit 6171bf7

Browse files
committed
Change global to globalThis
See huggingface/transformers.js#91 (comment)
1 parent 7c5269d commit 6171bf7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/hub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import path from 'path';
2020
* since we use a git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any identifier allowed by git.
2121
*/
2222

23-
if (global.ReadableStream === undefined && typeof process !== 'undefined') {
23+
if (globalThis.ReadableStream === undefined && typeof process !== 'undefined') {
2424
try {
2525
// @ts-ignore
26-
global.ReadableStream = require('node:stream/web').ReadableStream; // ReadableStream is not a global with Node 16
26+
globalThis.ReadableStream = require('node:stream/web').ReadableStream; // ReadableStream is not a global with Node 16
2727
} catch (err) {
2828
console.warn("ReadableStream not defined and unable to import from node:stream/web");
2929
}

0 commit comments

Comments
 (0)