英文:
'IonicStorageModule' does not appear to be an NgModule class
问题
我想按照Ionic Storage的官方文档操作,但出现以下错误:"index.d.ts(9, 9): This likely means that the library (@ionic/storage-angular) which declares IonicStorageModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy."
如何解决这个错误?
我的app.module.ts代码如下:
英文:
i want to do it like the offical documentation from ionic storage. but it says that "index.d.ts(9, 9): This likely means that the library (@ionic/storage-angular) which declares IonicStorageModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy."
how can i get rid of this error?
my code looks app.module.ts looks like this:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { IonicStorageModule } from '@ionic/storage-angular';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, IonicStorageModule.forRoot()],
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy}],
bootstrap: [AppComponent],
})
export class AppModule {}
答案1
得分: 5
似乎是当前 @ionic/storage-angular 包中的一个 bug
详见 https://github.com/ionic-team/ionic-storage/issues/293 了解更多信息
快速修复:
npm install @ionic/storage-angular@4.0.0-next.4
英文:
It seems to be a bug in the current @ionic/storage-angular package
see https://github.com/ionic-team/ionic-storage/issues/293 for more info.
Quick fix :
npm install @ionic/storage-angular@4.0.0-next.4
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论