Search code examples
angularamazon-web-servicesaws-amplify

aws-amplify AWSIoTProvider is not a constructor with Angular 8


I have followed below official link document official link. It is working fine with ng serve But when I build and than visit that page it is showing error like "AWSIoTProvider is not a constructor ". I am not getting any solution for this.

import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers';
Amplify.addPluggable(new AWSIoTProvider({
     aws_pubsub_region: '<YOUR-IOT-REGION>',
     aws_pubsub_endpoint: 'wss://xxxxxxxxxxxxx.iot.<YOUR-IOT-REGION>.amazonaws.com/mqtt',
   }));

Solution

  • I had the same issue with "aws-amplify": "^3.0.8", I have down graded to "aws-amplify": "^2.2.6", this worked for me.