‘IonicStorageModule’似乎不是一个NgModule类

huangapple go评论69阅读模式
英文:

'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

huangapple
  • 本文由 发表于 2023年5月6日 15:41:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76187698.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定