You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying since way too long to import this library in a React project using React's last version. At the moment, it's just a sandbox to try various things.
But I miserably fail everytime. I have tried to:
Import it in the public/index.html like any other "old school" scripts: "TS2304: Cannot find name 'EventSourcePolyfill'."
Import it in the public/index.html like any other "old school" scripts AND declare it as for angular by using declare var EventSourcePolyfill: any; : Uncaught SyntaxError: Unexpected token '<' (the < symbol is actually the beginning of the <!Doctype> tag of the public/index.html page
Import it like a module: import * as ES from "../node_modules/event-source-polyfill/src/eventsource.min.js"; -> nope: Could not find a declaration file for module '../node_modules/event-source-polyfill/src/eventsource.min.js'
Import it like a module: import EventSourcePolyfill from "../node_modules/event-source-polyfill/src/eventsource.min.js"; -> nope, same error
Import it like a module: import EventSourcePolyfill from "../node_modules/event-source-polyfill/src/eventsource.min.js"; -> nope, Could not find a declaration file for module 'event-source-polyfill'.
etc, etc...
I'm new to react, so i'm probably doing something wrong, but I hardly understand why we couldn't import it like any other module with a simple import EventSourcePolyfill from "event-source-polyfill";
Any idea / savior?
The text was updated successfully, but these errors were encountered:
Hi guys,
I'm trying since way too long to import this library in a React project using React's last version. At the moment, it's just a sandbox to try various things.
But I miserably fail everytime. I have tried to:
public/index.html
like any other "old school" scripts: "TS2304: Cannot find name 'EventSourcePolyfill'."public/index.html
like any other "old school" scripts AND declare it as for angular by usingdeclare var EventSourcePolyfill: any;
: Uncaught SyntaxError: Unexpected token '<' (the < symbol is actually the beginning of the <!Doctype> tag of thepublic/index.html
pageimport * as ES from "../node_modules/event-source-polyfill/src/eventsource.min.js";
-> nope: Could not find a declaration file for module '../node_modules/event-source-polyfill/src/eventsource.min.js'import EventSourcePolyfill from "../node_modules/event-source-polyfill/src/eventsource.min.js";
-> nope, same errorimport EventSourcePolyfill from "../node_modules/event-source-polyfill/src/eventsource.min.js";
-> nope, Could not find a declaration file for module 'event-source-polyfill'.etc, etc...
I'm new to react, so i'm probably doing something wrong, but I hardly understand why we couldn't import it like any other module with a simple
import EventSourcePolyfill from "event-source-polyfill";
Any idea / savior?
The text was updated successfully, but these errors were encountered: