Skip to content

[@types/node] @types/node@22.8.5 and @types/node@20.17.4 break builds that do not target ECMAScript 2015 or higher #71050

@dreusel

Description

@dreusel

Discussed in #71049

Originally posted by dreusel October 31, 2024
These versions, released 6 hours ago, break our builds with the following error:

node_modules/@types/node/events.d.ts:144:18 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

144         readonly #internalTypeOnlyBrand?: Events;
                     ~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@types/node/events.d.ts:144

I suppose this should not happen with a patch release. The same project builds fine with @types/node@22.8.4 or @types/node@20.17.3

My tsconfig:

{
        "include": ["lib/*", "lib/**/*"],
        "compilerOptions": {
                "allowJs": true,
                "declaration": true,
                "emitDeclarationOnly": true,
                "outDir": "dist",
                "declarationMap": true,
                "skipLibCheck": true
        }
}

My build command:
tsc --build && tsc dist/*.d.ts dist/**/*.d.ts

(intended to build the type files, then check if the generated files are actually correct)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions