JvSomeren / vue-peerjs

MIT License
14 stars 4 forks source link

[Request] Support for Vue3 #14

Open YoussF opened 3 years ago

YoussF commented 3 years ago

Hello,

I'm currently trying to migrate my application from Vue2 to Vue3, and it seems like vue-peerjs is not compatible with vue3.

// PEERJS VUEJS INTEGRATION
import VuePeerJS from 'vue-peerjs';
import Peer from 'peerjs';

const app = createApp(App)
  .use(VuePeerJS, new Peer({
            config: {
              'iceServers': [
                    { url: 'stun:stun.l.google.com:19302' }
              ]},
  }))

and here is the console log errors:

vue-peerjs.esm.js?0724:1 Uncaught TypeError: Cannot set property '$peer' of undefined
    at Object.install (vue-peerjs.esm.js?0724:1)
    at Object.use (runtime-core.esm-bundler.js?5c40:3408)
    at eval (main.js?56d7:43)
    at Module../src/main.js (app.js:1168)
    at __webpack_require__ (app.js:854)
    at fn (app.js:151)
    at Object.1 (app.js:1264)
    at __webpack_require__ (app.js:854)
    at checkDeferredModules (app.js:46)
    at app.js:994

I'm not sure if I can do something on my side to make this work. Thank you for your support, Y.