0

鉴于此,我得到了这个输出......

import { Client } from '@twilio/conversations';

... crap....

this.client = new Client(this.token);
      this.client.on('stateChanged', state => {
        if (state === 'initialized') {
          this.ready = true;
          this.emitter.emit('ready');

... more stuff....
browser.js?edd1:6945 Uncaught (in promise) TypeError: twilsock.InitRegistration is not a constructor
at new Client (browser.js?edd1:6945:1)
at _class._createSuperInternal (browser.js?7253:148:1)
at new _class (browser.js?7253:239:1)
at eval (TwilioProvider.js?d6b9:149:1)
at new Promise (<anonymous>)
at TwilioProvider.start (TwilioProvider.js?d6b9:135:1)
at eval (start.js?e8a3:39:1)
at Object.eval [as dispatch] (index.js?4dd3:11:1)
at dispatch (<anonymous>:10607:80)
at eval (redux.js?a67e:483:1)

我已经在该行停止了调试器,这是该行上 twilsock 的值......有什么建议吗?

调试值

4

1 回答 1

1

问题是由于纱线链接将 twilsock 解析为旧版本。我通过将版本更改为 link:{filepath} 来硬链接它,一切都很好。

于 2022-01-31T17:10:54.767 回答