johnnyfittizio johnnyfittizio - 16 days ago 10
Node.js Question

cloud-angular has no exported member provideCloud

THE SITUATION

I have setup a blank app. Installed

@ionic/cloud-angular
and imported
provideCloud
.

But I am getting the following error:

cloud-angular has no exported member 'provideCloud'


cloud-angular has no exported member provideCloud

(I have a similar error for ionicBootstrap)

THE STEPS:


  1. ionic start whateva blank --v2

  2. npm install @ionic/cloud-angular --save

  3. ionic io init

  4. Import provideCloud



THE CODE:

import { provideCloud, CloudSettings } from '@ionic/cloud-angular';
import { ionicBootstrap, Platform } from 'ionic-angular';


Ionic info:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
Ionic App Scripts Version: 0.0.44
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: OS X El Capitan
Node Version: v4.6.0
Xcode version: Xcode 7.3.1 Build version 7D1014


Package.json dependencies:

"dependencies": {
"@angular/common": "2.1.1",
"@angular/compiler": "2.1.1",
"@angular/compiler-cli": "2.1.1",
"@angular/core": "2.1.1",
"@angular/forms": "2.1.1",
"@angular/http": "2.1.1",
"@angular/platform-browser": "2.1.1",
"@angular/platform-browser-dynamic": "2.1.1",
"@angular/platform-server": "2.1.1",
"@ionic/cloud-angular": "^0.7.0",
"@ionic/storage": "1.1.6",
"ionic-angular": "2.0.0-rc.2",
"ionic-native": "2.2.3",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.21"
},
"devDependencies": {
"@ionic/app-scripts": "0.0.44",
"typescript": "2.0.6"
},


THE QUESTION:

Why I am getting the error?

I have just setup a new blank app.. There is something wrong in the setup?

Thanks!

QoP QoP
Answer

When version 0.7.0 was released, provideCloud was replaced with CloudModule as you can see in their code.

The new way to set up your cloud setting is as follows

import { CloudSettings, CloudModule } from '@ionic/cloud-angular';

const cloudSettings: CloudSettings = {
  'core': {
    'app_id': 'APP_ID'
  }
};

@NgModule({
  declarations: [ ... ],
  imports: [
    IonicModule.forRoot(MyApp),
    CloudModule.forRoot(cloudSettings)
  ],
  bootstrap: [IonicApp],
  entryComponents: [ ... ],
  providers: [ ... ]
})
export class AppModule {}
Comments