Amplify-js: aws-amplify AWSIoTProvider is not a constructor with Angular 8

Created on 25 Apr 2020  路  6Comments  路  Source: aws-amplify/amplify-js

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',
   }));

Above issue occurred, after upgrading the "aws-amplify" from "^2.2.6" to "^3.0.8" version.

Please help me to resolve the issue.

Thanks in advance!

pending-close-response-required

Most helpful comment

Had the same issue. As a workaround, changing
import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers';
to
import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers/AWSIotProvider';
worked for me.

All 6 comments

Same issue here but in Angular 9.1.1

Had the same issue. As a workaround, changing
import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers';
to
import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers/AWSIotProvider';
worked for me.

Had the same issue. As a workaround, changing
import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers';
to
import { AWSIoTProvider } from '@aws-amplify/pubsub/lib/Providers/AWSIotProvider';
worked for me.

@WolfWalter Thanks for sharing. What version of Angular you are using? Regards

I just updated to Angular 9.1.4.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

Was this page helpful?
0 / 5 - 0 ratings