westonsoftware / vue-webrtc

WebRTC video component for Vue.js
MIT License
369 stars 127 forks source link

Uncaught Reference Errors Breaking App #129

Closed Tykki closed 1 year ago

Tykki commented 1 year ago

Describe the bug The application breaks and reverts to blank white page when adding vue-webrtc to project, the console gives back Uncaught ReferenceError: global is not defined at vue-webrtc.esm.js:837:18

Which is just this line var globalThis = global;

To Reproduce Steps to reproduce the behavior:

  1. create new vue/ts project with npm init vite@latest
  2. cd to new project and install vue-webrtc via npm i 'vue-webrtc', also install rest of deps with npm i
  3. edit main.ts with VueWebRTC import and add component to app
  4. run project with npm run dev
  5. See error, check console to see global not defined error

Expected behavior A working App. To see the Vue+Vite default page

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context I can remedy the global issue by including a tag in the head of project that includes var global = window.global. But then I get hit with the same error but for Buffer is not defined.

westonsoftware commented 1 year ago

@Tykki any suggestions on how to fix this?
We've had reports of this before ... #110 This seems to be a vite problem ... any chance you can use webpack?