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:
create new vue/ts project with npm init vite@latest
cd to new project and install vue-webrtc via npm i 'vue-webrtc', also install rest of deps with npm i
edit main.ts with VueWebRTC import and add component to app
run project with npm run dev
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):
OS: Windows 11
Browser Chrome
Version 114.0.5735.134 (Official Build) (64-bit)
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
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.
@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?
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:
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.