React-Native aws-amplify PubSub错误

时间:2018-05-02 19:51:33

标签: react-native aws-amplify

import Amplify, { Auth } from 'aws-amplify'
import config from './aws-exports'
import { PubSub } from 'aws-amplify';
import { AWSIoTProvider } from 'aws-amplify/lib/PubSub/Providers';

...

PubSub.subscribe('myTopicTest').subscribe({
   next: data => console.log('Message received', data),
   error: error => console.error(error),
   close: () => console.log('Done'),
}); 

对PubSub.subscribe的调用抛出:

TypeError:assign的一个源在原型链上有一个可枚举的键。您是否尝试分配原型属性?我们不允许这样做,因为这是我们不支持的边缘情况。此错误是性能优化,不符合规范。

参考: https://github.com/aws/aws-amplify/issues/750

是否有人针对此错误提供了解决方法或解决方案?

由于

0 个答案:

没有答案