Twilio Conversations twilsock.InitRegistration() 不是构造函数
Twilio Conversations twilsock.InitRegistration() is not a constructor
鉴于此,我得到了这个输出...
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 在该行的值...有什么建议吗?
问题是由于 yarn link 将 twilsock 解析为旧版本。我通过将版本更改为 link:{filepath} 来 link 编辑它,一切都很好。
鉴于此,我得到了这个输出...
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 在该行的值...有什么建议吗?
问题是由于 yarn link 将 twilsock 解析为旧版本。我通过将版本更改为 link:{filepath} 来 link 编辑它,一切都很好。