Yaffle/EventSource

EventSourcePolyfill is not defined

Open

#129 opened on 2019年3月24日

GitHub で見る
 (5 comments) (0 reactions) (0 assignees)JavaScript (1,873 stars) (320 forks)batch import
help wanted

説明

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?

コントリビューターガイド