aws-amplify warning after updating angular application to the latest version 10.0

I have updated the angular application to the latest version, and keep getting the warning message from the @aws-amplify. I know angular 10 doesn’t remend to use commonjs. Since the @aws-amplify is on that, how can I remove the warning?

I tried adding allowedCommonJsDependencies in angular.json

 "allowedCommonJsDependencies": [
          "crypto-js", "@aws-sdk/eventstream-marshaller", "buffer", "js-cookie", 
          "@aws-crypto", "zen-observable", "@aws-sdk/util-utf8-node", "@aws-crypto/sha256-js", "@aws-sdk/util-buffer-from",
          "@aws-sdk/smithy-client", "@aws-sdk/middleware-serde", "@aws-sdk/middleware-user-agent",
          "@aws-sdk/middleware-retry", "@aws-sdk/middleware-signing", "@aws-sdk/middleware-content-length",
          "@aws-sdk/middleware-host-header", "@aws-sdk/config-resolver", "@aws-sdk/s3-request-presigner",
          "@aws-sdk/util-format-url", "@aws-sdk/util-create-request", "@aws-sdk/property-provider",
          "axios", "@aws-sdk/fetch-http-handler", "@aws-sdk/protocol-http", "@aws-sdk/querystring-builder",
          "@aws-sdk/util-utf8-browser", "@aws-sdk/url-parser-browser", "@aws-crypto/sha256-browser",
          "@aws-sdk/url-parser-node", "@aws-sdk/util-uri-escape", "@aws-sdk/middleware-sdk-s3",
          "@aws-sdk/middleware-bucket-endpoint", "@aws-sdk/querystring-parser", "@aws-sdk/middleware-apply-body-checksum",
          "@aws-sdk/middleware-ssec", "@aws-sdk/middleware-expect-continue", "fast-xml-parser",
          "@aws-sdk/xml-builder", "@aws-sdk/md5-js", "@aws-sdk/hash-blob-browser",
          "@aws-sdk/eventstream-serde-browser", "@aws-sdk/middleware-location-constraint", "uuid",
          "@aws-sdk/credential-provider-cognito-identity", "@aws-sdk/eventstream-serde-config-resolver",
          "@aws-sdk/client-s3","@aws-sdk/client-pinpoint",
          "ulid", "zen-push", "lodash", "@aws-amplify/core", "@aws-amplify/analytics","@aws-amplify/ui-components"
          ]

warnings

WARNING in /Users/macbook/Projects/src/app/shared/components/forms/datepicker/datepicker.component.ts depends on 'inputmask'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/src/app/shared/directives/multi-select.directive.ts depends on 'util'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/src/app/shared/directives/duration.directive.ts depends on 'moment-timezone'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/ui-components/dist/esm/loader.mjs depends on '@aws-amplify/core'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/datastore/lib-esm/datastore/datastore.js depends on 'uuid'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSPinpointProvider.js depends on 'uuid'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/analytics/lib-esm/Providers/AmazonPersonalizeProvider.js depends on 'lodash/isEmpty'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/analytics/lib-esm/Providers/AmazonPersonalizeProvider.js depends on 'lodash/isEqual'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/analytics/lib-esm/Providers/AmazonPersonalizeProvider.js depends on 'lodash/get'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/amazon-cognito-identity-js/es/CognitoUser.js depends on 'buffer'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/amazon-cognito-identity-js/es/AuthenticationHelper.js depends on 'crypto-js/hmac-sha256'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/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 info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/zen-observable-ts/lib/bundle.esm.js depends on 'zen-observable'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSKinesisFirehoseProvider.js depends on '@aws-sdk/util-utf8-browser'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/amazon-cognito-identity-js/es/CookieStorage.js depends on 'js-cookie'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/storage/lib-esm/providers/AWSS3Provider.js depends on '@aws-sdk/s3-request-presigner'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/storage/lib-esm/providers/AWSS3Provider.js depends on '@aws-sdk/util-format-url'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/storage/lib-esm/providers/AWSS3Provider.js depends on '@aws-sdk/util-create-request'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/amazon-cognito-identity-js/es/Client.js depends on 'isomorphic-unfetch'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-lex-runtime-service/dist/es/commands/DeleteSessionCommand.js depends on '@aws-sdk/smithy-client'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-pinpoint/dist/es/PinpointClient.js depends on '@aws-sdk/middleware-signing'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-pinpoint/dist/es/PinpointClient.js depends on '@aws-sdk/middleware-user-agent'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-pinpoint/dist/es/PinpointClient.js depends on '@aws-sdk/middleware-retry'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-pinpoint/dist/es/PinpointClient.js depends on '@aws-sdk/middleware-host-header'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-pinpoint/dist/es/PinpointClient.js depends on '@aws-sdk/config-resolver'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-pinpoint/dist/es/PinpointClient.js depends on '@aws-sdk/middleware-content-length'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-pinpoint/dist/es/commands/UpdateEndpointsBatchCommand.js depends on '@aws-sdk/middleware-serde'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-s3/dist/es/commands/UploadPartCopyCommand.js depends on '@aws-sdk/middleware-ssec'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-s3/dist/es/commands/UploadPartCopyCommand.js depends on '@aws-sdk/middleware-bucket-endpoint'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-s3/dist/es/S3Client.js depends on '@aws-sdk/middleware-sdk-s3'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-s3/dist/es/S3Client.js depends on '@aws-sdk/middleware-expect-continue'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-s3/dist/es/S3Client.js depends on '@aws-sdk/eventstream-serde-config-resolver'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-s3/dist/es/commands/PutBucketTaggingCommand.js depends on '@aws-sdk/middleware-apply-body-checksum'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-sdk/client-s3/dist/es/commands/CreateBucketCommand.js depends on '@aws-sdk/middleware-location-constraint'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/macbook/Projects/node_modules/@aws-amplify/predictions/lib-esm/Providers/AmazonAIConvertPredictionsProvider.js depends on '@aws-sdk/util-utf8-node'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Some of the blogs I followed

https://github.com/angular/angular-cli/issues/18025

https://github.com/aws-amplify/amplify-js/issues/6202

Source: Angular Questions

One Reply to “aws-amplify warning after updating angular application to the latest version 10.0”

  • I would concur. One thing thats mildly bugging me as I stray from the pre-built city of Angular is if I start using 3rd Party stuff it becomes much more tedious to manage versions. Something like ‘npm outdated’ is going to update more than just the packages I’m using, thus possibly breaking angular i.e. zone.js, typescript and other things that certain packages depend on. I don’t know if someone has a smarter solution to this, but I had to hand roll quite a bit here and I feel like I have to dedicate a few hours to this effort. After adjusting I still get –
    Warning: ./node_modules/amazon-cognito-identity-js/es/utils/cryptoSecureRandomInt.js
    Module not found: Error: Can’t resolve ‘crypto’ in ‘/Volumes/SDUltra/Development/Web/frameworks/ng-portal/node_modules/amazon-cognito-identity-js/es/utils’

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.