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

EventEmitter doesn't exist in browsers #310

Open
francislavoie opened this issue Jun 22, 2022 · 1 comment
Open

EventEmitter doesn't exist in browsers #310

francislavoie opened this issue Jun 22, 2022 · 1 comment

Comments

@francislavoie
Copy link

francislavoie commented Jun 22, 2022

Describe the bug

After playing around with some of my frontend project's package.json dependencies, I ended up yeeting some of the deps that provided node polyfills along the way, and that made this lib no longer work because of this line:

import { EventEmitter } from "events";

More specifically, when my HTTP Transport is constructed, it would hit this line, and I would get EventEmitter is not a constructor

this.transportEventChannel = new EventEmitter();

I had to install events@^3.3.0 to fix it.

Expected behavior

This lib should either depend on events so that I don't need to require it myself, or it should use APIs that actually exist in the browser.

@zcstarr
Copy link
Member

zcstarr commented Sep 12, 2022

Nice catch! Thanks for the issue we'll take dive into this.

beviu added a commit to ApollineRodary/Endive that referenced this issue Feb 14, 2024
The @openrpc/client-js library has a bug[1] and this package needs to be
added to make it work. I don't fully understand the details :(

This package is a dependency of codemirror-languageserver and other
people seem to have the same issue[2].

[1]: open-rpc/client-js#310
[2]: FurqanSoftware/codemirror-languageserver#26
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

2 participants