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

Error: "URL is not a constructor" #258

Closed
tim-ebner opened this issue Mar 4, 2022 · 2 comments
Closed

Error: "URL is not a constructor" #258

tim-ebner opened this issue Mar 4, 2022 · 2 comments

Comments

@tim-ebner
Copy link

Hi,

first of all thanks for the great library.

With version 2.0.0 I get an error as soon as I receive events:

Uncaught TypeError: URL is not a constructor
    at parseEventStreamLine (eventsource.js:296:19)
    at exports.IncomingMessage.eval (eventsource.js:250:11)
    at exports.IncomingMessage.emit (events.js:153:5)
    at exports.IncomingMessage.Readable.read (_stream_readable.js:469:26)
    at flow (_stream_readable.js:813:34)
    at resume_ (_stream_readable.js:796:3)
    at afterTickTwo (index.js:28:10)
    at eval (process.js:5:12)

With version 1.1.0 everything works all right. Even if I install version 1.1.0 and after that version 2.0.0.
Maybe due to dependency issues?

I am using webpack for building the package.

Since version 1.1.0 works fine for me I am going to wait with the upgrade.

@tim-ebner tim-ebner changed the title Error "url" is not constructor Error: "URL is not a constructor" Mar 4, 2022
@joeybaker
Copy link
Contributor

Fixed in #268

@christian-knecht
Copy link

Still receiving the same error in the browser (Uncaught TypeError: URL is not a constructor) using eventsource-polyfill.js bundled with webpack 5.72.0.

Having a look at the bundled file, webpack adds the following import:

/* WEBPACK VAR INJECTION */(function(process, Buffer) {var parse = __webpack_require__(6).parse var URL = __webpack_require__(6).URL

Do you have any suggestions how to solve this?

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