Skip to content

EventEmitter doesn't exist in browsers #310

Open
@francislavoie

Description

@francislavoie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions