#2560·encore

Typescript Check fails on @types/node v26.4.0 and higher

Author: jessewang-arvatosystemsCreated Sep 2, 2026Updated Sep 2, 2026

Is there an existing issue for this?

  • I have searched the existing issues

What part(s) of Encore does this bug report apply to?

  • Encore.ts (TypeScript)
  • Encore.go (Go)
  • Encore CLI
  • Local Development Dashboard
  • Encore Cloud

Current behavior

When @types/node is set to 26.4.0 or higher, the typescript check fails.

> tsc --noEmit --skipLibCheck

node_modules/encore.dev/api/node_http.ts(36,19): error TS2352: Conversion of type 'DummySocket' to type 'Socket' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Types of property 'setKeepAlive' are incompatible.
    Type '(_enable?: boolean | undefined, _initialDelay?: number | undefined) => DummySocket' is not comparable to type '{ (options: SetKeepAliveOptions): Socket; (enable?: boolean | undefined, initialDelay?: number | undefined, interval?: number | undefined, count?: number | undefined): Socket; }'.
      Types of parameters '_enable' and 'options' are incompatible.
        Type 'SetKeepAliveOptions' is not comparable to type 'boolean | undefined'.
node_modules/encore.dev/api/node_http.ts(150,19): error TS2352: Conversion of type 'DummySocket' to type 'Socket' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Types of property 'setKeepAlive' are incompatible.
    Type '(_enable?: boolean | undefined, _initialDelay?: number | undefined) => DummySocket' is not comparable to type '{ (options: SetKeepAliveOptions): Socket; (enable?: boolean | undefined, initialDelay?: number | undefined, interval?: number | undefined, count?: number | undefined): Socket; }'.
      Types of parameters '_enable' and 'options' are incompatible.
        Type 'SetKeepAliveOptions' is not comparable to type 'boolean | undefined'.

Minimum reproduction code

No response

Steps to reproduce

In package.json, change @types/node to version 26.4.0 or higher.

  "devDependencies": {
    ....
    "@types/node": "26.4.0",
    ....
  }

Run tsc: tsc --noEmit --skipLibCheck.

Works as expected when @types/node is set to version 26.3.0.

Expected behavior

There should be no errors with running tsc

Encore CLI version

1.58.4

Node.js version

26.7.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response