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
[BUG] 11.0.4 "[ERROR] TS2315: Type 'Uint8Array' is not generic. [plugin angular-compiler]" build error in Angular 18 and 19 #856
I am not using version 13.x of node (if so, please upgrade)
Description of the problem
The latest patch version 11.0.4 is no longer usable with Angular 18 and 19 because the patch version is requiring Typescript 5.7 which is not supported by Angular 18 and 19.
It worked with previous 11.0.X versions.
It causes the following build error:
✘ [ERROR] TS2315: Type 'Uint8Array' is not generic. [plugin angular-compiler]
node_modules/uuid/dist/cjs/parse.d.ts:1:38:
1 │ declare function parse(uuid: string): Uint8Array<ArrayBuffer>;
╵ ~~~~~~~~~~~~~~~~~~~~~~~
✘ [ERROR] TS2315: Type 'Uint8Array' is not generic. [plugin angular-compiler]
node_modules/uuid/dist/cjs/v35.d.ts:2:52:
2 │ ...clare function stringToBytes(str: string): Uint8Array<ArrayBuffer>;
╵ ~~~~~~~~~~~~~~~~~~~~~~~
✘ [ERROR] TS2315: Type 'Uint8Array' is not generic. [plugin angular-compiler]
node_modules/uuid/dist/cjs/v35.d.ts:6:165:
6 │ ...Uint8Array, offset?: number): string | Uint8Array<ArrayBufferLike>;
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Recipe for reproducing
No response
Additional information
No response
Environment
No response
Reacted by Alex Heinz, Martin Irigaray, Sergej Sintschilin, SaschaSchwarz, Hannes, Ilya Konrad, Christoph Meyer and Gary Sheppard
For future reference, this is exactly why we have this in the issue template:
"IMPORTANT: Failure to provide a Minimal, Complete, and Verifiable example will result in this issue being closed without further review."
I can confirm the uuid typedefs changed between 11.0.3 and 11.0.4 as a result of updating from TS 5.6 -> 5.7. But I don't have a way of easily reproducing your issue so my interest / ability in fixing this is limited. That this would cause breaking changes is unexpected, given that TS 5.6 -> 5.7 is a semver-minor change.
That said... the TS blog post about this recommends updating to the latest @types/node version. Can one of you try that and report back here on whether or not that fixes the problem?
changed the title [-][BUG] 11.0.4 no longer usable with Angular 18 and 19[/-][+][BUG] 11.0.4 "Type 'Uint8Array' is not generic" build error in Angular 18 and 19[/+]on Jan 7, 2025
changed the title [-][BUG] 11.0.4 "Type 'Uint8Array' is not generic" build error in Angular 18 and 19[/-][+][BUG] 11.0.4 "[ERROR] TS2315: Type 'Uint8Array' is not generic. [plugin angular-compiler]" build error in Angular 18 and 19[/+]on Jan 7, 2025
@broofa On most normal dependencies this would probably have been fine. But this concerns Typescript, so any changes can be very impactful, it strictly compiles everyone's code-bases, so can result in many different experiences. The fact that the TS update 5.6 -> 5.7 was treated as a semver-minor change, but was rolled into UUID as a semver-patch from 11.0.3 -> 11.0.4 is what's hurting a lot right now. Also no mention of this TS dependency upgrade on the 11.0.4 change log.
Does the 11.0.4 release need the TS 5.7 upgrade? If not, could a 11.0.5 patch with a TS 5.6 downgrade be an option?
Nope. That update was just my muscle memory kicking in. I've been in the habit of updating all the dev dependencies on this project whenever I sit down to work on it. Historically, that hasn't been an issue as none of those dependencies changed the API. That's also why that update got flagged as a "chore", which is why it doesn't show up in the CHANGELOG.
Obviously the addition of built-in TS support and the typescript dependency break that... so... yeah, this is just me catching up to the TS support requirements.
Unless someone here objects, I thinki the best solution is to pin the dependency to typescript@5.0.4. That should (?) insure support for the last two years of TS releases, which is the support strategy I find myself settling on for TypeScript. I'm not aware of any features introduced since then that are critical to this project.
REQUEST: Can someone here put up an MRE example of this problem, please. E.g. a small code snippet that depends on uuid (but notangular) that breaks when compiled with tsc?
I'd like to put some unit tests in place that capture TS support issues like this.
Unless someone here objects, I thinki the best solution is to pin the dependency to typescript@5.0.4. That should (?) insure support for the last two years of TS releases, which is the support strategy I find myself settling on for TypeScript. I'm not aware of any features introduced since then that are critical to this project.
@broofa No real objections to fixing on that specific version, but I have seen in a few projects that they currently pin their TypeScript dependency like this : "typescript": ">=4.9.3 <5.2".
Activity
spawnrider commentedon Jan 7, 2025
Same for me here. Need to rollback to 11.0.3.
andyf0x commentedon Jan 7, 2025
Same here, but for Angular 16. Fixing on 11.0.3 has resolved the issue.
broofa commentedon Jan 7, 2025
For future reference, this is exactly why we have this in the issue template:
I can confirm the uuid typedefs changed between 11.0.3 and 11.0.4 as a result of updating from TS 5.6 -> 5.7. But I don't have a way of easily reproducing your issue so my interest / ability in fixing this is limited.
That this would cause breaking changes is unexpected, given that TS 5.6 -> 5.7 is a semver-minor change.That said... the TS blog post about this recommends updating to the latest
@types/nodeversion. Can one of you try that and report back here on whether or not that fixes the problem?[-][BUG] 11.0.4 no longer usable with Angular 18 and 19[/-][+][BUG] 11.0.4 "Type 'Uint8Array' is not generic" build error in Angular 18 and 19[/+][-][BUG] 11.0.4 "Type 'Uint8Array' is not generic" build error in Angular 18 and 19[/-][+][BUG] 11.0.4 "[ERROR] TS2315: Type 'Uint8Array' is not generic. [plugin angular-compiler]" build error in Angular 18 and 19[/+]broofa commentedon Jan 7, 2025
Related TS issue microsoft/TypeScript#60638 (marked as "not a defect", fwiw)
gabynevada commentedon Jan 7, 2025
@broofa I'm still getting the issue on the latest @types/node package. The issue seems to be typescript package incompatibility.
Typescript does not follow semver (microsoft/TypeScript#14116) so all minor versions can include and most times include breaking changes.
On angular projects they don't support typescript 5.7 yet so the fix for now is reverting to 11.0.3
andyf0x commentedon Jan 8, 2025
@broofa On most normal dependencies this would probably have been fine. But this concerns Typescript, so any changes can be very impactful, it strictly compiles everyone's code-bases, so can result in many different experiences. The fact that the TS update 5.6 -> 5.7 was treated as a semver-minor change, but was rolled into UUID as a semver-patch from 11.0.3 -> 11.0.4 is what's hurting a lot right now. Also no mention of this TS dependency upgrade on the 11.0.4 change log.
Does the 11.0.4 release need the TS 5.7 upgrade? If not, could a 11.0.5 patch with a TS 5.6 downgrade be an option?
broofa commentedon Jan 9, 2025
Nope. That update was just my muscle memory kicking in. I've been in the habit of updating all the dev dependencies on this project whenever I sit down to work on it. Historically, that hasn't been an issue as none of those dependencies changed the API. That's also why that update got flagged as a "chore", which is why it doesn't show up in the CHANGELOG.
Obviously the addition of built-in TS support and the
typescriptdependency break that... so... yeah, this is just me catching up to the TS support requirements.Unless someone here objects, I thinki the best solution is to pin the dependency to
typescript@5.0.4. That should (?) insure support for the last two years of TS releases, which is the support strategy I find myself settling on for TypeScript. I'm not aware of any features introduced since then that are critical to this project.broofa commentedon Jan 9, 2025
REQUEST: Can someone here put up an MRE example of this problem, please. E.g. a small code snippet that depends on
uuid(but notangular) that breaks when compiled withtsc?I'd like to put some unit tests in place that capture TS support issues like this.
david-schopf-senacor commentedon Jan 9, 2025
Reproduction example
package.json
index.ts
import { v4 } from "uuid";Run tsc
node_modules/typescript/bin/tsc index.tsResult
ExpliuM commentedon Jan 9, 2025
Same here
andyf0x commentedon Jan 9, 2025
@broofa No real objections to fixing on that specific version, but I have seen in a few projects that they currently pin their TypeScript dependency like this : "typescript": ">=4.9.3 <5.2".
broofa commentedon Jan 9, 2025
Fix published in
uuid@11.0.5.