Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Types error while using it in import [Angular] TS #190

Open
noobd3v opened this issue Aug 23, 2021 · 1 comment
Open

Getting Types error while using it in import [Angular] TS #190

noobd3v opened this issue Aug 23, 2021 · 1 comment

Comments

@noobd3v
Copy link

noobd3v commented Aug 23, 2021

Could not find a declaration file for module 'event-source-polyfill'. '../node_modules/event-source-polyfill/src/eventsource.js' implicitly has an 'any' type.
Try npm i --save-dev @types/event-source-polyfill if it exists or add a new declaration (.d.ts) file containing declare module 'event-source-polyfill';ts(7016)

import { NativeEventSource, EventSourcePolyfill } from 'event-source-polyfill';

@ericwangkai
Copy link

@noobd3v I am using EventSource in my angular project. There is a file named polyfills.ts under root folder. Just add the below into it. Hope this helps.

import 'event-source-polyfill/src/eventsource.min.js';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants