简体   繁体   English

aws-amplify AWSIoTProvider 不是具有 Angular 8 的构造函数

[英]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 " .它与ng serve一起工作正常但是当我构建并访问该页面时它显示错误,如“AWSIoTProvider 不是构造函数” 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',
   }));

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.我对“aws-amplify”有同样的问题:“^3.0.8”,我已经降级到“aws-amplify”:“^2.2.6”,这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM