Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Module "events" has been externalized for browser compatibility. Cannot access "events.EventEmitter" in client code #56

Closed
dtgbao opened this issue Aug 28, 2022 · 2 comments

Comments

@dtgbao
Copy link

dtgbao commented Aug 28, 2022

Describe the bug
Error appear in console and cannot play video when running npm-sdk sample code on Vitejs

Package info
"amazon-ivs-player": "^1.12.0"

Sample Code:
https://stackblitz.com/edit/vitejs-aws-ivs?file=src%2Fplayer.ts&terminal=dev

Screenshots
image

@johnBartos
Copy link
Contributor

I'm not familiar with Vite, is this an issue with that library? I see something similar in their issue tracker vitejs/vite#4479

If there's an improvement we can make to support Vite, let me know.

@florence-wolfe
Copy link
Contributor

Webpack defaults to using node-libs-browser when specifying the web platform. This means that any time it would encounter any of the known compatible node libs it'll be replaced with an equivalent web implementation. In our case, that happens with the events module.

Vite, on the other hand is built on top of rollup which doesn't include this behavior by default but gives you the ability to add it in with its flexible configuration.

There's an open issue in the Vite repo actively discussing this.

Closing as this is a bundler issue and not a player nor sample bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants