diff --git a/server/server.js b/server/server.js index 03b33a0..7271733 100644 --- a/server/server.js +++ b/server/server.js @@ -8,11 +8,23 @@ let fastbootAppServer = new FastbootAppServer({ gzip: true, log: true, buildSandboxGlobals(defaultGlobals) { - return Object.assign( - {}, - defaultGlobals, - {BACKEND_URL: "http://backend"} - ); + return Object.assign({}, defaultGlobals, { + AbortController, + ReadableStream: + typeof ReadableStream !== "undefined" + ? ReadableStream + : require("node:stream/web").ReadableStream, + WritableStream: + typeof WritableStream !== "undefined" + ? WritableStream + : require("node:stream/web").WritableStream, + TransformStream: + typeof TransformStream !== "undefined" + ? TransformStream + : require("node:stream/web").TransformStream, + Headers: typeof Headers !== "undefined" ? Headers : undefined, + BACKEND_URL: "http://backend", + }); }, });