I attempted to utilize the crypto.randomUUID function in my Angular app version 13.1, however, it does not seem to be accessible. When trying to use it, I encountered this error:
TS2339: Property 'randomUUID' does not exist on type 'Crypto'
It appears that support for this function was incorporated into TypeScript version 4.6 as mentioned in this GitHub pull request. Unfortunately, Angular 13.1 is not compatible with TypeScript 4.6 which results in the following error:
Error: The Angular Compiler requires TypeScript >=4.4.2 and <4.6.0 but found version 4.6.3 instead.
Is there a workaround to add the current implementation of crypto.randomUUID
for TypeScript 4.5?
While my preference was to avoid using uuid and its associated TypeScript types directly, I am open to utilizing it as a polyfill for TypeScript 4.5 if necessary.