Unable to place a call using Twilio JS Client, Laravel 9 Vite and AlpineJS: TypeError: 'get' on proxy: property '_operations' is a read-only

问题描述 投票:0回答:0

我在使用 Laravel 9 Vite 和 AlpineJS 进行某些 UI 交互时无法拨打电话。我收到以下错误:

TypeError: 'get' on proxy: property '_operations' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '#<AsyncQueue>' but got '#<AsyncQueue>')
    at Proxy.stop (twilio.min.js:1:203005)
    at Proxy.<anonymous> (twilio.min.js:1:64095)
    at step (twilio.min.js:1:51274)
    at Object.next (twilio.min.js:1:50534)
    at fulfilled (twilio.min.js:1:49928)

在浏览器控制台中。 错误发生在这个函数的 try / catch 块的第一行:

makeBrowserCall: async function () {
    console.log('makeBrowserCall', this.to, this.dialFrom)
    let params = {
        To: this.to,
        From: this.dialFrom
    }
    console.log('params', params, this.device)
    if (this.device) {
        try {
            this.call = await this.device.connect(params)
            console.log(this.call)
            this.call.on("accept", updateUIAcceptedOutgoingCall)
            this.call.on("disconnect", updateUIDisconnectedOutgoingCall)
            this.call.on("cancel", updateUIDisconnectedOutgoingCall)
        } catch (error) {
            console.log(error)
        }

    }

我跑的地方

device.connect()

我还可以毫无问题地打印参数、

to
from
属性。但是,我收到了这个奇怪的错误。有人可以帮忙吗?啊,我能够通过这个功能更早地初始化设备:

 initializeDevice: function () {
    console.log(this.token)
    this.device = new Twilio.Device(this.token, {
        debug: true,
        logLevel: 1,
        codecPreferences: ['opus', 'pcmu'],

    })

感谢您的帮助:)

laravel twilio vite twilio-api
© www.soinside.com 2019 - 2024. All rights reserved.