ngx-cache
ngx-cache copied to clipboard
Getting Error in ng serve
ERROR in node_modules/@ngx-cache/platform-browser/browser-cache.module.d.ts(11,21): error TS2694: Namespace '"node_modules/@angular/core/core"' has no exported member 'ɵɵNgModuleDefWithMeta'. node_modules/@ngx-cache/platform-browser/browser-cache.module.d.ts(12,21): error TS2694: Namespace '"node_modules/@angular/core/core"' has no exported member 'ɵɵInjectorDef'. node_modules/@ngx-cache/platform-browser/local-storage-cache.service.d.ts(4,17): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@ngx-cache/platform-browser/local-storage-cache.service.d.ts(6,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@ngx-cache/platform-browser/memory-cache.service.d.ts(5,17): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@ngx-cache/platform-browser/memory-cache.service.d.ts(7,9): error TS1086: An accessor cannot be declared in an ambient context.
Current behavior I have installed version 9.0.0 and getting above errors in ng serve. Also Please refer my versions of application
Angular CLI: 6.2.9 Node: 10.16.0 OS: darwin x64 Angular: 6.1.10 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router, service-worker
Package Version
@angular-devkit/architect 0.8.9 @angular-devkit/build-angular 0.8.9 @angular-devkit/build-optimizer 0.8.9 @angular-devkit/build-webpack 0.8.9 @angular-devkit/core 0.8.9 @angular-devkit/schematics 0.8.9 @angular/cdk 7.3.7 @angular/cli 6.2.9 @angular/material 7.3.7 @angular/pwa 0.8.9 @ngtools/webpack 6.2.9 @schematics/angular 0.8.9 @schematics/update 0.8.9 rxjs 6.5.5 typescript 2.9.2 webpack 4.16.4
Expected/desired behavior Working with all versions of angular
Minimal reproduction of the problem with instructions I have used these two plugins for implement caching
"@ngx-cache/core": "^6.0.0", "@ngx-cache/platform-browser": "^9.0.0",
and please refer below my app.module.ts file configurations
import { CacheModule, CACHE } from '@ngx-cache/core';
import { BrowserCacheModule, MemoryCacheService } from '@ngx-cache/platform-browser';
imports: [
CacheModule.forRoot(),
BrowserCacheModule.forRoot([
{
provide: CACHE,
useClass: MemoryCacheService // or, LocalStorageCacheService
}
]),
],
Environment
-
Angular version: 6.1.10
-
For Tooling issues:
- Node version: v10.16.0
- Platform: Mac
Also happens on Angular 13.2.2.
npm: 6.14.10 node: 14.15.4 OS: Windows 10
Build at: 2022-02-11T10:52:40.352Z - Hash: 12cf9ea505b4d954 - Time: 7417ms
Error: node_modules/@ngx-cache/core/cache.module.d.ts:12:21 - error TS2694: Namespace '"<omitted>/node_modules/@angular/core/core"' has no exported member 'ɵɵN
gModuleDefWithMeta'.
12 static ɵmod: i0.ɵɵNgModuleDefWithMeta<CacheModule, never, never, never>;
~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/@ngx-cache/core/cache.service.d.ts:31:21 - error TS2694: Namespace '"<omitted>/node_modules/@angular/core/core"' has no exported member 'ɵɵ
FactoryDef'.
31 static ɵfac: i0.ɵɵFactoryDef<CacheService, never>;
~~~~~~~~~~~~
Error: node_modules/@ngx-cache/core/cache.service.d.ts:32:22 - error TS2724: '"<omitted>/node_modules/@angular/core/core"' has no exported member named 'ɵɵInje
ctableDef'. Did you mean 'ɵgetInjectableDef'?
32 static ɵprov: i0.ɵɵInjectableDef<CacheService>;
~~~~~~~~~~~~~~~
Error: node_modules/@ngx-cache/platform-browser/browser-cache.module.d.ts:11:21 - error TS2694: Namespace '"<omitted>/node_modules/@angular/core/core"' has no
exported member 'ɵɵNgModuleDefWithMeta'.
11 static ɵmod: i0.ɵɵNgModuleDefWithMeta<BrowserCacheModule, never, never, never>;
~~~~~~~~~~~~~~~~~~~~~
× Failed to compile.