I am attempting to integrate AWS-Amplify(^4.3.0) with angular-12 and typescript (4.3.5). I have followed the documentation to configure amplify properly, but when trying to start the app, I encountered some amplify errors as shown below.
Warning: D:\Google Sign-IN Demo\google-test\node_modules\amazon-cognito-identity-js\es\AuthenticationHelper.js depends on 'crypto-js/lib-typedarrays'. CommonJS or AMD dependencies can cause optimization bailouts. For more information, please refer to: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: D:\Google Sign-IN Demo\google-test\node_modules\amazon-cognito-identity-js\es\Client.js depends on 'isomorphic-unfetch'. CommonJS or AMD dependencies can cause optimization bailouts. For more information, please refer to: https://angular.io/guide/build#configuring-commonjs-dependencies
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]> & { ~~~~
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) | undefined' is not assignable to type '(...args: any) => any'. Type 'undefined' is not assignable to type '(...args: any) => any'.
58 declare type PickProviderOutput<DefaultOutput, T, api extends StorageProviderApi> = T extends StorageProvider ? T['getProviderName'] extends 'AWSS3' ? Promise : ReturnType<T[api]> : T extends {
Following the documentation, after fully configuring AWS-Amplify with Cognito, I added the following code in main.ts:
import Amplify from "aws-amplify";
import aws_exports from "./aws-exports";
Amplify.configure(aws_exports);
Any assistance would be greatly appreciated! Please advise me on where I might be going wrong?