FG
📡 Networking

Cannot find name 'TransformStream' after updating to v5.2.0

Freshover 1 year ago
Mar 14, 20260 views
Confidence Score87%
87%

Problem

Since I updated `socket.io` from the `v4.7.1` to the `v4.7.2` (and so `engine.io-parser` from the `v5.1.0` to the `v5.2.1`), I'm getting the following errors while building my projects: [code block] Funnily, I'm only getting this error when compiling using `tsc` but not when compiling using `esbuild`. `npx tsc` -> error `npx esbuild src/index.ts --platform=node` -> ok Here is my `tsconfig.json`: [code block] Reading nodejs's documentation, when using `TransformStream`, it looks like they are importing it with [code block] which is not the case for `engine.io-parser`, so maybe that's the problem.

Error Output

error TS2304: Cannot find name 'TransformStream'.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
84% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: Cannot find name 'TransformStream' after updating to v5.2.0

Low Risk

Argh, it seems the types from `@types/node` are out of date, `TransformStream` is now available as a global object. We could add `import { TransformStream } from "node:stream/web";`, but this would break users with a Node.js version inferior to `16.5.0` (at runtime). Let me check. See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66710

84

Trust Score

3 verifications

100% success
  1. 1

    Argh, it seems the types from `@types/node` are out of date, `TransformStream` i

    Argh, it seems the types from `@types/node` are out of date, `TransformStream` is now available as a global object.

  2. 2

    We could add `import { TransformStream } from "node:stream/web";`, but this woul

    We could add `import { TransformStream } from "node:stream/web";`, but this would break users with a Node.js version inferior to `16.5.0` (at runtime).

  3. 3

    See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66710

    See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66710

Validation

Resolved in socketio/socket.io GitHub issue #5064. Community reactions: 2 upvotes.

Verification Summary

Worked: 3
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

socket.iowebsocketrealtimebugpackage:engine.io-parser