From 9f28bd605258e751b7fe187058e51df24d0ff692 Mon Sep 17 00:00:00 2001 From: Ajinkya Rajput Date: Thu, 21 Apr 2022 14:20:31 +0530 Subject: [PATCH 1/3] Make it again browser compatible --- lib/eventsource.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/eventsource.js b/lib/eventsource.js index caece0d..ffcbe37 100644 --- a/lib/eventsource.js +++ b/lib/eventsource.js @@ -1,5 +1,4 @@ var parse = require('url').parse -var URL = require('url').URL var events = require('events') var https = require('https') var http = require('http') From f52ed5018c53d670237d5519f105715f8f1f481a Mon Sep 17 00:00:00 2001 From: Ajinkya Rajput Date: Fri, 22 Apr 2022 11:18:37 +0530 Subject: [PATCH 2/3] Standard: Make URL is global variable --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index bcfeba8..393d195 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,9 @@ "standard": { "ignore": [ "example/eventsource-polyfill.js" + ], + "globals": [ + "URL" ] } } From a759bc5c7eaf929571fceff0fa98fc21120e29f8 Mon Sep 17 00:00:00 2001 From: Ajinkya Rajput Date: Fri, 22 Apr 2022 22:47:32 +0530 Subject: [PATCH 3/3] Update HISTORY.md --- HISTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 25059c7..ea2210b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +# [2.0.1](https://github.com/EventSource/eventsource/compare/v2.0.0...v2.0.1) + +* Fix `URL is not a constructor` error for browser ([#268](https://github.com/EventSource/eventsource/pull/268) Ajinkya Rajput) + # [2.0.0](https://github.com/EventSource/eventsource/compare/v1.1.0...v2.0.0) * BREAKING: Node >= 12 now required ([#152](https://github.com/EventSource/eventsource/pull/152) @HonkingGoose)