Ionic 3 typescript transpile error : typescript: node_modules/@ionic/storage/index.d.ts

Hi,

I am facing an transpile typescript issue with storage plugin in ionic 3 project after upgrading storage plugin to 5.0.0. Project was running fine before upgrading the plugin.

[09:55:48] typescript: node_modules/@ionic/storage/index.d.ts, line: 5
Type ‘ModuleWithProviders’ is not generic.

   L4:  export declare class IonicStorageModule {
   L5:      static forRoot(storageConfig?: StorageConfig): ModuleWithProviders<IonicStorageModule>;

[09:55:48] typescript: node_modules/@ionic/storage/storage.d.ts, line: 113
An accessor cannot be declared in an ambient context.

 L112:  get driver(): string | null;
 L114:   * Reflect the readiness of the store.

[09:55:49] ionic-app-script task: “build”
[09:55:49] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError

Here is my package.json dependencies

@angular/animations”: “5.2.11”,
@angular/common”: “5.2.11”,
@angular/compiler”: “5.2.11”,
@angular/compiler-cli”: “^8.2.6”,
@angular/core”: “5.2.11”,
@angular/forms”: “5.2.11”,
@angular/http”: “5.2.11”,
@angular/platform-browser”: “5.2.11”,
@angular/platform-browser-dynamic”: “5.2.11”,
@ionic-native/app-version”: “^4.20.0”,
@ionic-native/background-mode”: “^4.20.0”,
@ionic-native/barcode-scanner”: “^4.20.0”,
@ionic-native/core”: “4.8.0”,
@ionic-native/device”: “^4.20.0”,
@ionic-native/flurry-analytics”: “4.20.0”,
@ionic-native/http”: “^4.20.0”,
@ionic-native/in-app-browser”: “^5.28.0”,
@ionic-native/keyboard”: “^4.20.0”,
@ionic-native/local-notifications”: “^4.7.0”,
@ionic-native/spinner-dialog”: “^5.5.1”,
@ionic-native/splash-screen”: “4.8.0”,
@ionic-native/status-bar”: “4.8.0”,
@ionic-native/unique-device-id”: “^4.20.0”,
@ionic-native/vibration”: “^5.3.0”,
@ionic/storage”: “^2.3.1”,
@ng-idle/core”: “^2.0.0-beta.15”,
@ng-idle/keepalive”: “^7.0.0-beta.1”,
@ngx-translate/core”: “^9.1.1”,
@ngx-translate/http-loader”: “^4.0.0”,
“a”: “2.1.2”,
“angular-sweetalert-service”: “^2.0.2”,
“angular-user-idle”: “^1.1.0”,
“angular2-moment”: “^1.9.0”,
“bn-ng-idle”: “0.0.2”,
“cordova-android”: “8.1.0”,
“cordova-browser”: “5.0.4”,
“cordova-ios”: “^5.0.1”,
“cordova-plugin-app-version”: “^0.1.9”,
“cordova-plugin-background-mode”: “0.7.3”,
“cordova-plugin-badge”: “^0.8.8”,
“cordova-plugin-certificates”: “^0.6.4”,
“cordova-plugin-cocoapod-support”: “1.6.2”,
“cordova-plugin-device”: “2.0.3”,
“cordova-plugin-flurryanalytics”: “1.4.6”,
“cordova-plugin-ionic-keyboard”: “^2.1.3”,
“cordova-plugin-ionic-webview”: “^5.0.0”,
“cordova-plugin-local-notification”: “^0.9.0-beta.2”,
“cordova-plugin-native-spinner”: “1.1.3”,
“cordova-plugin-splashscreen”: “^5.0.2”,
“cordova-plugin-uniquedeviceid”: “^1.3.2”,
“cordova-plugin-vibration”: “^3.1.0”,
“cordova-plugin-whitelist”: “^1.3.3”,
“cordova-sqlite-storage”: “5.0.1”,
“ionic-angular”: “3.9.2”,
“ionicons”: “3.0.0”,
“phonegap-plugin-barcodescanner”: “^8.0.1”,
“rxjs”: “5.5.11”,
“rxjs-compat”: “^6.4.0”,
“sw-toolbox”: “3.6.0”,
“sweetalert2”: “^8.12.0”,
“ts-data.stack”: “^1.0.6”,
“zone.js”: “0.8.26”

Dev dependencies as below

Ionic:

Ionic CLI : 5.2.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : MyApplication, android 8.1.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 5.0.0, (and 17 other plugins)

Utility:

cordova-res : not installed
native-run : 0.2.7 (update available: 1.1.0)

System:

ios-sim : 8.0.2
NodeJS : v10.13.0 (/usr/local/bin/node)
npm : 6.14.8
OS : macOS Catalina
Xcode : Xcode 10.1 Build version 10B61

Anyone can suggest me the possible issue with this?

I would suggest reverting your most recent changes and going back to a known good baseline. What you have posted here is a trainwreck of incompatible stuff. It would be harder if not impossible to fix this going forward than it would to go back to what was working.

It is generally not going to work to make any upgrades to dependencies, especially significant ones, on Ionic 3 projects today. The world has moved on.

If you do require further assistance, please also include the devDependencies you’re working with, not just the runtime ones.

Hi,

Dev dependencies as below

Ionic:

Ionic CLI : 5.2.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : MyApplication, android 8.1.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 5.0.0, (and 17 other plugins)

Utility:

cordova-res : not installed
native-run : 0.2.7 (update available: 1.1.0)

System:

ios-sim : 8.0.2
NodeJS : v10.13.0 (/usr/local/bin/node)
npm : 6.14.8
OS : macOS Catalina
Xcode : Xcode 10.1 Build version 10B61

That’s helpful, but not what I meant. I was talking about the devDependencies stanza in package.json. No matter, the most important thing is to get your project reverted back to the state where it was building successfully, so do that first.