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

aws-amplify AWSIoTProvider is not a constructor with Angular 8

我已关注以下官方 link 文档 official link。它与 ng serve 一起工作正常但是当我 build 并且访问该页面时它显示错误 "AWSIoTProvider is not a constructor "。我没有得到任何解决方案。

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

我遇到了与 "aws-amplify" 相同的问题:“^3.0.8”,我已将评分降为 "aws-amplify":“^2.2.6”,这对我有用。