Skip to content

[@types/node] Drops support for TypeScript < 3.7 in 12.20.21 ("assert.d.ts:2:68 - error TS1144: '{' or ';' expected.") #55430

Closed

Description

@Chealer

This report was for some reason created as "discussion" #55429 ; moving to a proper ticket.

Our TypeScript 3.5 project stopped compiling yesterday, due to an upgrade to @types/node 12.20.21, with a bunch of errors:

ERROR in ../node_modules/@types/node/assert.d.ts:2:68 - error TS1144: '{' or ';' expected.
2 function assert(value: any, message?: string | Error): asserts value;

image

This would be no surprise as TypeScript 3.5 is fairly old and DefinitelyTyped does not support old versions indefinitely, except after analysis it turns out our package.json properly specify the dependency:
"@types/node": "^12.7.1",

In fact, @types/node had already dropped support for TypeScript 3.6, but for some reason, this week this change was backported to branch 12, and while 12.20.20 was fine, 12.20.21 drops support, breaking semantic versioning.

The exact reason why TypeScript 3.5 now fails to compile is usage of TypeScript 3.7 assertion functions.

Activity

  1. changed the title [-][@types/node] Drops support for TypeScript < 3.7 in 12.20.21("assert.d.ts:2:68 - error TS1144: '{' or ';' expected.")[/-] [+][@types/node] Drops support for TypeScript < 3.7 in 12.20.21 ("assert.d.ts:2:68 - error TS1144: '{' or ';' expected.")[/+] on Aug 27, 2021
  2. sandersn commented on Sep 3, 2021

    @sandersn
    Contributor

    See my comments on the discussion; this is by design and you'll need to specify 12.20.20 exactly if you're outside the 2-year DT support window.

  3. Chealer commented on Sep 10, 2021

    @Chealer
    Author

    Thanks @sandersn but there is no need to specify exact versions with any regular package. npm allows to express dependencies with precise version constraints such as foo ~1.0.0 for version 1.0 (less than 1.1), which will suffice for all packages with semantic versioning.

  4. Chealer commented on Sep 23, 2021

    @Chealer
    Author

    Is there a reason why this ticket is closed?

    Also, if the claim about DefinitelyTyped not truly supporting semantic versioning in discussion #55429 is correct, then the README, which discusses semantic versioning much, must specify that DefinitelyTyped has no such support.

  5. eric-burel commented on Jan 10, 2022

    @eric-burel

    Hi, a similar issue is back with recent version of TS, 4.5.4 raises this issue, while 4.2 does not.
    I have a non minimal repro if necessary:https://github.com/VulcanJS/npm-the-right-way, see my-package-esbuild. Updating TS will break yarn run buid:types.

  6. added a commit that references this issue on Jan 11, 2022
  7. added a commit that references this issue on May 20, 2023
  8. added a commit that references this issue on May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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