webcrypto-liner icon indicating copy to clipboard operation
webcrypto-liner copied to clipboard

Incompatible with TypeScript 4.4

Open kumaheiyama opened this issue 2 years ago • 3 comments

When using webcrypto-liner with typescript >4.2.4 I get the same error as discussed in this webcrypto-core issue.

Looking at the webcrypto-liner package.json it is still using "webcrypto-core": "^1.2.0"

kumaheiyama avatar Dec 06 '21 14:12 kumaheiyama

I tried forking the repo and updating to webcrypto-core 1.2.1, and the build works. However I'm getting the following error message when trying with the latest 1.4.0:

src/lib.ts → build/index.js, build/index.es.js...
[!] (plugin rpt2) Error: C:/Source/webcrypto-liner/src/subtle.ts(223,26): semantic error TS2339: Property 'apply' does not exist on type '((algorithm: AlgorithmIdentifier, data: BufferSource, ...args: any[]) => Promise<ArrayBuffer>) | ProviderStorage | ... 10 more ... | ((format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsag...'.
  Property 'apply' does not exist on type 'ProviderStorage'.
src\subtle.ts
Error: C:/Source/webcrypto-liner/src/subtle.ts(223,26): semantic error TS2339: Property 'apply' does not exist on type '((algorithm: AlgorithmIdentifier, data: BufferSource, ...args: any[]) => Promise<ArrayBuffer>) | ProviderStorage | ... 10 more ... | ((format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsag...'.  Property 'apply' does not exist on type 'ProviderStorage'.
    at error (C:\Source\webcrypto-liner\node_modules\rollup\dist\shared\rollup.js:5239:30)

kumaheiyama avatar Dec 07 '21 08:12 kumaheiyama

@kumaheiyama I've published the fixed version [email protected]. Please try it

microshine avatar Dec 07 '21 15:12 microshine

Sorry for late response, seems to be working with @1.3.1! Thanks @microshine

kumaheiyama avatar Mar 25 '22 10:03 kumaheiyama