Skip to content

Commit

Permalink
fix: prevent crash when accessing TextDecoder (#684)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
iowaguy committed Jun 27, 2023
1 parent 9608781 commit 6dd2bc4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type { CookieSerializeOptions } from "cookie";
import type { CorsOptions, CorsOptionsDelegate } from "cors";
import type { Duplex } from "stream";
import { WebTransport } from "./transports/webtransport";
import { TextDecoder } from "util";

const debug = debugModule("engine");

Expand Down

0 comments on commit 6dd2bc4

Please sign in to comment.