peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.44k stars 1.43k forks source link

Error : (intermediate value)(intermediate value)(intermediate value) is not a constructor #1063

Open erdemoden opened 1 year ago

erdemoden commented 1 year ago

I want to make a game using cocos creator I Installed peerjs and I write bellow code :

import { _decorator, Component, Node } from 'cc';
import Peer from 'peerjs';
const { ccclass, property } = _decorator;

@ccclass('deneme')
export class deneme extends Component {
    start() {
        const peer = new Peer();
        peer.on("open",(id)=>{
            console.log(id);
        });
    }

    update(deltaTime: number) {

    }
}

but when I run my game it gaves error : [Preview] (intermediate value)(intermediate value)(intermediate value) is not a constructor how can I solve it please help me

jonasgloning commented 1 year ago

I'm sorry to hear that @erdemoden. Is this still happening with the latest PeerJS version?