aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

[Feedback] Error TS2344 (@aws-amplify/storage/lib-esm/types/Storage.d.ts) #8955

Closed rolance closed 3 years ago

rolance commented 3 years ago

Page: /start/getting-started/data-model/q/integration/[integration]

Feedback: using Angular CLI: 12.2.7, Node: 12.14.0, Package Manager: npm 6.14.8, OS: win32 x64

Error: node_modules/@aws-amplify/storage/lib-esm/types/Storage.d.ts:44:46 - error TS2344: Type 'T[U]' does not satisfy the constraint '(...args: any) => any'. Type 'T["get"] | T["copy"] | T["put"] | T["remove"] | T["list"]' is not assignable to type '(...args: any) => any'. Type 'T["copy"]' is not assignable to type '(...args: any) => any'. Type '((src: StorageCopyTarget, dest: StorageCopyDestination, config?: any) => Promise) | ((src: StorageCopyTarget, dest: StorageCopyDestination, config?: any) => Promise<...>) | undefined' is not assignable to type '(...args: any) => any'. Type 'undefined' is not assignable to type '(...args: any) => any'.

44 } : U extends 'copy' ? never : LastParameter<T[U]> & {

rolance commented 3 years ago

Had to add "skipLibCheck": true to compilerOptions in tsconfig.json to get things to work.

thomasturrell commented 3 years ago

Maybe this issue should be added to the amplify-js repository.

I am seeing build errors with the same error.

Rolled back to @aws-amplify/storage 4.3.11 from @aws-amplify/storage 4.4.1 to resolve issue.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.