You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[@types/node] Drops support for TypeScript < 3.7 in 12.20.21 ("assert.d.ts:2:68 - error TS1144: '{' or ';' expected.") #55430
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;
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.
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
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.
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.
Activity
[-][@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.")[/+]sandersn commentedon Sep 3, 2021
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.
Chealer commentedon Sep 10, 2021
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.
Chealer commentedon Sep 23, 2021
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.
eric-burel commentedon Jan 10, 2022
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 breakyarn run buid:types.Update Node types and TypeScript
build: Fix typescript errors
fix `npm run compile` got `node_modules/@types/node/assert.d.ts:2:68 …
build: Fix typescript errors