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

util.inherits is not a function #246

Open
enverbisevac opened this issue Feb 17, 2022 · 5 comments
Open

util.inherits is not a function #246

enverbisevac opened this issue Feb 17, 2022 · 5 comments

Comments

@enverbisevac
Copy link

I tried to integrate this lib into my project using ViteJS but error is displayed:
Uncaught TypeError: util.inherits is not a function
at node_modules/eventsource/lib/eventsource.js

@hong-duc
Copy link

My workaround is to use the EventSourcePolyfill

cosnt es = new window['EventSourcePolyfill']('http://example.com')

Hope this help someone while wait for a fix

@Addeuz
Copy link

Addeuz commented May 12, 2022

@hong-duc how do you populate window with EventSourcePolyfill?

@rexxars
Copy link
Member

rexxars commented May 16, 2022

In general I would recommend you use a browser-oriented polyfill if that is what you need - eg https://github.com/amvtek/EventSource

@Addeuz
Copy link

Addeuz commented May 17, 2022

I don't have a need for it really. I was just curious on how to do it since I would like to use this polyfill.. But because of the bug I've had to resort to using this: https://github.com/Yaffle/EventSource even if it did some political changes..

@hd10180
Copy link

hd10180 commented Mar 3, 2023

face the same problem too

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

5 participants