Wednesday, 23 March 2022

Property 'subtle' does not exist on type 'typeof webcrypto'

I'm using Node v17.4 and want to consume the webcrypto API. Based on this example I'm trying to import subtle into my project but TypeScript comes up with the error

Property 'subtle' does not exist on type 'typeof webcrypto'.

The only thing the namespace webcrypto offers is this.

import crypto from 'crypto';
const { subtle } = crypto.webcrypto; // subtle doesn't exist

How do I get access to subtle ?



from Property 'subtle' does not exist on type 'typeof webcrypto'

No comments:

Post a Comment