fulls1z3 / ngx-cache

Cache utility for Angular
MIT License
154 stars 16 forks source link

Unable to use with Angular 11 #136

Closed alihoseiny closed 3 years ago

alihoseiny commented 3 years ago

I'm submitting a ... (check one with "x")

[ ] Regression (a behavior that used to work and stopped working in a new release)
[X ] Bug report  <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request

Current behavior

Getting error TS2694: Namespace '"node_modules/@angular/core/core"' has no exported member 'ɵɵNgModuleDefWithMeta'. exception after updating to Angular 11. This plugin is no longer usable for newer versions of Angular.

m7mdbadawy commented 3 years ago

I made a pull request for angular 11 here maybe it will help you https://github.com/fulls1z3/ngx-cache/pull/137

I didn't encounter your problem so I am not sure if it fixes it

mczachurski commented 3 years ago

I'm experiencing same issue. It's easy to reproduce. We have to create new application (by Angular CLI 12):

$ ng new TestApp
$ cd TestApp
$ npm install @ngx-cache/core @ngx-cache/platform-browser --save

Add to app.component.ts file function:

@Cached('some-string')
getSomeStringValue(): string {
    return 'some string value';
}

And after: ng build I have an error:

Error: node_modules/@ngx-cache/core/cache.service.d.ts:32:22 - error TS2724: '"/Users/mczachurski/Downloads/Angular12/TestApp3/node_modules/@angular/core/core"' has no exported member named 'ɵɵInjectableDef'. Did you mean 'ɵgetInjectableDef'?

32     static ɵprov: i0.ɵɵInjectableDef<CacheService>;

Thus it seems that library cannot be used in new Angular applications at all. Do you have any plans to merge PR and create new NPM version?

fulls1z3 commented 3 years ago

see https://github.com/fulls1z3/ngx-cache/pull/141