Yaffle/EventSource

EventSourcePolyfill is not defined

Open

#129 opened on Mar 24, 2019

View on GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (1,873 stars) (320 forks)batch import
help wanted

Description

Im working in ionic 4.10.2 with angular 7.3.5.

npm install event-source-polyfill

Then added this to the top of my file:

import 'event-source-polyfill/src/eventsource.js' declare var EventSourcePolyfill: any;

And then using it like this:

    this.source = new EventSourcePolyfill(url, {
      headers: {
        "Authorization": "Bearer " + this.userService.user.token,
        "X-Requested-With": "XMLHttpRequest"
      }
    });

I then get the following error:

ERROR ReferenceError: EventSourcePolyfill is not defined

I've checked that the path is correct. Any other things Im missing?

Contributor guide

EventSourcePolyfill is not defined · Yaffle/EventSource#129 | Good First Issue