eventsource icon indicating copy to clipboard operation
eventsource copied to clipboard

ERROR TypeError: (intermediate value)(intermediate value)(intermediate value).request is not a function

Open udhayakumarcp opened this issue 4 years ago • 6 comments

Hi Team,

I am using this package in the Angular application. Please find angular environment details below image

I am trying to use SSE through this package by using the following code

import  EventSource  from 'eventsource';

const eventSourceUrl = 'http://localhost:3000/v1/notifications';

const eventSourceInitDict = { headers: { Authorization: 'Tokken' } };
const noticationEventSource = new EventSource(eventSourceUrl, eventSourceInitDict);

But unfortunately, it throws the following error ERROR TypeError: (intermediate value)(intermediate value)(intermediate value).request is not a function

udhayakumarcp avatar Jan 04 '22 06:01 udhayakumarcp

I am getting the same error in Angular 13

ERROR Error: Uncaught (in promise): TypeError: (intermediate value)(intermediate value)(intermediate value).request is not a function
TypeError: (intermediate value)(intermediate value)(intermediate value).request is not a function
    at connect (eventsource.js:146:37)
    at new EventSource (eventsource.js:283:3)
    ...
    at tryCatch (runtime.js:63:40)
    at Generator.invoke [as _invoke] (runtime.js:294:22)
    at Generator.next (runtime.js:119:21)
    at tslib.es6.js:76:1
    at new ZoneAwarePromise (zone.js:1387:29)
    at __awaiter (tslib.es6.js:72:1)
    ...
    at resolvePromise (zone.js:1213:31)
    at new ZoneAwarePromise (zone.js:1390:17)
    at __awaiter (tslib.es6.js:72:1)
    ...
    at executeListenerWithErrorHandling (core.mjs:14979:16)
    at wrapListenerIn_markDirtyAndPreventDefault (core.mjs:15017:22)
    at HTMLButtonElement.<anonymous> (platform-browser.mjs:466:38)
    at ZoneDelegate.invokeTask (zone.js:406:31)
    at Object.onInvokeTask (core.mjs:25535:33)

kevincentius avatar Jun 03 '22 15:06 kevincentius

Hi, i have the same error with vue, in an electron app using vite and quasar.

eventsource version : 2.0.2

image

zeid0ne avatar Apr 05 '23 14:04 zeid0ne