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

Missed events package causes crash #68

Open
berdyshev opened this issue Apr 26, 2024 · 0 comments
Open

Missed events package causes crash #68

berdyshev opened this issue Apr 26, 2024 · 0 comments

Comments

@berdyshev
Copy link

berdyshev commented Apr 26, 2024

The PopupStore class extends EventEmitter class from events package. There is a standard NodeJS library with such a name and a kind of polyfil as events package on NPM. Usually it might be already installed as a dependency in your project by other tools (in my cause it's webpack and its plugins) But if not, the react-popup package might brake an app.

Once I replaced Webpack with Vite the app broke with the following error:

Uncaught TypeError: Super expression must either be null or a function
    at _inherits (react-popup.js?v=5c9bd9e2:367:15)
    at react-popup.js?v=5c9bd9e2:430:7
    at node_modules/react-popup/dist/Store.js (react-popup.js?v=5c9bd9e2:506:6)

So, I would recommend to either add the events library as a dependency, or find another way to implement event emitting using browser's native APIs (e.g. EventTarget).

@berdyshev berdyshev changed the title events dependency is not specified Missed events package causes crash Apr 26, 2024
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

1 participant