Skip to content

Commit 6dd2bc4

Browse files
authored
fix: prevent crash when accessing TextDecoder (#684)
The TextDecoder object was added on the global object in Node.js v11.0.0, so older versions would throw: > ReferenceError: TextDecoder is not defined Reference: https://nodejs.org/api/util.html#new-textdecoderencoding-options
1 parent 9608781 commit 6dd2bc4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/server.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import type { CookieSerializeOptions } from "cookie";
1616
import type { CorsOptions, CorsOptionsDelegate } from "cors";
1717
import type { Duplex } from "stream";
1818
import { WebTransport } from "./transports/webtransport";
19+
import { TextDecoder } from "util";
1920

2021
const debug = debugModule("engine");
2122

0 commit comments

Comments
 (0)