peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

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

Open erdemoden opened this issue 2 years ago • 1 comments

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

erdemoden avatar Mar 29 '23 10:03 erdemoden

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

jonasgloning avatar Sep 03 '23 16:09 jonasgloning