Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript compilation errors (e.g. @ts-expect-error unreachable code) #602

Open
3 of 4 tasks
pleerock opened this issue Feb 4, 2025 · 0 comments
Open
3 of 4 tasks

Comments

@pleerock
Copy link

pleerock commented Feb 4, 2025

What's happening?

This library gives bunch of typescript errors, I have tried multiple recent versions - errors in all of them. The latest 1.0.0-beta releases do not contain such errors, but do contain errors with Buffer. I have the latest TypeScript compiler version.

Reproducible Code

no code required

Relevant log output

packages/app/mobile/node_modules/react-native-quick-crypto/src/aes.ts:87:7 - error TS2578: Unused '@ts-expect-error' directive.

87       // @ts-expect-error unreachable code
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/aes.ts:98:7 - error TS2578: Unused '@ts-expect-error' directive.

98       // @ts-expect-error unreachable code
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/aes.ts:109:7 - error TS2578: Unused '@ts-expect-error' directive.

109       // @ts-expect-error unreachable code
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/aes.ts:120:7 - error TS2578: Unused '@ts-expect-error' directive.

120       // @ts-expect-error unreachable code
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/aes.ts:124:3 - error TS2578: Unused '@ts-expect-error' directive.

124   // @ts-expect-error unreachable code
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/Hash.ts:138:3 - error TS2740: Type 'Buffer' is missing the following properties from type 'ArrayBuffer': maxByteLength, resizable, resize, detached, and 2 more.

138   return hash.digest();
      ~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/pbkdf2.ts:86:3 - error TS2740: Type 'Buffer' is missing the following properties from type 'ArrayBuffer': maxByteLength, resizable, resize, detached, and 2 more.

86   return Buffer.from(result);
     ~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/subtle.ts:374:3 - error TS2578: Unused '@ts-expect-error' directive.

374   // @ts-expect-error unreachable code
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/Utils.ts:194:7 - error TS2322: Type 'ArrayBuffer | SharedArrayBuffer' is not assignable to type 'ArrayBuffer'.
  Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength

194       return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
          ~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/Utils.ts:196:7 - error TS2322: Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
  Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength

196       return buf.buffer;
          ~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/Utils.ts:774:5 - error TS2578: Unused '@ts-expect-error' directive.

774     // @ts-expect-error - input[n] is possibly undefined
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/app/mobile/node_modules/react-native-quick-crypto/src/Utils.ts:786:5 - error TS2322: Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
  Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength

786     return buffer.buffer;

Device

none

QuickCrypto Version

^0.7.11

Can you reproduce this issue in the QuickCrypto Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

@pleerock pleerock changed the title 🐛 TypeScript compilation errors (e.g. @ts-expect-error unreachable code) Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant