Ionic 5 Cordova Plugin EmailComposer NullInjectorError - ionic-framework

I'm doing an App using Ionic 5 and Capacitor.
package.json
"dependencies": {
"#angular/common": "~9.1.6",
"#angular/core": "~9.1.6",
"#angular/fire": "^6.0.2",
"#angular/forms": "~9.1.6",
"#angular/platform-browser": "~9.1.6",
"#angular/platform-browser-dynamic": "~9.1.6",
"#angular/router": "~9.1.6",
"#capacitor/android": "^2.4.0",
"#capacitor/core": "^2.4.0",
"#capacitor/ios": "^2.4.0",
"#ionic-native/core": "^5.27.0",
"#ionic-native/email-composer": "^5.28.0",
"#ionic/angular": "^5.2.3",
"cordova-plugin-email-composer": "^0.9.2",
"rxjs": "~6.5.1",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
}
I have installed the plugin Email Composer to open the email client of the user to send an email.
Installation with Capacitor:
npm install cordova-plugin-email-composer
npm install #ionic-native/email-composer
ionic cap sync
I have created a service to implement the logic of sending emails:
import {Injectable} from '#angular/core';
import {EmailComposer, EmailComposerOptions} from "#ionic-native/email-composer/ngx";
#Injectable()
export class EmailService {
constructor(
private emailComposer: EmailComposer
) {
}
private get isEmailClientConfigured(): Promise<boolean> {
return this.emailComposer.isAvailable();
}
/**
* Tries to open an email client and populate the fields.
*/
intentToSend(to: string) {
if (this.isEmailClientConfigured) {
const email: EmailComposerOptions = {
to: to,
isHtml: false
};
this.emailComposer.open(email);
} else {
console.log('Could not find an email configured.');
}
}
}
Error in console:
ERROR Error: Uncaught (in promise): NullInjectorError:
R3InjectorError(ContentModule)[EmailService -> EmailComposer ->
EmailComposer -> EmailComposer -> EmailComposer]:
NullInjectorError: No provider for EmailComposer! NullInjectorError:
R3InjectorError(ContentModule)[EmailService -> EmailComposer ->
EmailComposer -> EmailComposer -> EmailComposer]:
NullInjectorError: No provider for EmailComposer!
After seeing this, I have added it on my ngModule:
import {NgModule} from '#angular/core';
import {EmailComposer} from "#ionic-native/email-composer";
#NgModule({
declarations: [
],
imports: [
],
providers: [
EmailComposer
]
})
export class SharedModule {
}
Now I receive this error in console:
core.js:6228 ERROR Error: Uncaught (in promise): Error: Invalid
provider for the NgModule 'SharedModule' - only instances of Provider
and Type are allowed, got: [..., ..., ..., ..., ..., ?[object
Object]?] Error: Invalid provider for the NgModule 'SharedModule' -
only instances of Provider and Type are allowed, got: [..., ..., ...,
..., ..., ?[object Object]?]
Any idea how can I fix this?
My goal is to install and implement the plugin EmailComposer correctly on my project.

Add EmailComposer in AppModule's provider
import {EmailComposer} from "#ionic-native/email-composer/ngx";
#NgModule({
declarations: [AppComponent ],
imports: [
BrowserModule,
IonicModule.forRoot(),
AppRoutingModule,
],
providers: [
...
EmailComposer
],
bootstrap: [AppComponent]
})
export class AppModule {}

To add onto the answer of Praveen Patel above, try changing the import code from
import {EmailComposer} from "#ionic-native/email-composer";
to this: (note the '/ngx')
import {EmailComposer} from "#ionic-native/email-composer/ngx";

Add useClass with provide
import {EmailComposer} from "#ionic-native/email-composer";
import { IonicNativePlugin } from '#ionic-native/core';
...
...
...
providers: [
...
{ provide: EmailComposer, useClass: IonicNativePlugin}
]

Related

Error: Cannot find module "#ionic/angular"

i'm trying to implement ion2-calendar from
https://github.com/hsuanxyz/ion2-calendar
but when i trying to imported to my app.module.ts
i get this error :
Uncaught Error: Cannot find module "#ionic/angular"
at webpackMissingModule (calendar.modal.js:13)
at Object.<anonymous> (calendar.modal.js:13)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.<anonymous> (index.js:7)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.355 (main.ts:5)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.332 (main.ts:1)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at webpackJsonpCallback (bootstrap ff18038c92faa82fd673:25)
my app.module.ts
import { BrowserModule } from '#angular/platform-browser';
import { ErrorHandler, NgModule } from '#angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '#ionic-native/splash-screen';
import { StatusBar } from '#ionic-native/status-bar';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { Http, Headers, RequestOptions, HttpModule } from '#angular/http';
import { CalendarModule } from 'ion2-calendar';
#NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,HttpModule,
IonicModule.forRoot(MyApp),
CalendarModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
don't know what's wrong
Looks like you've downloaded the ionic 4 version of the library. Try using https://github.com/HsuanXyz/ion2-calendar/tree/v2 this version is set up for ionic-angular not #ionic/angular which it looks like your verson is. Hope this helps :)

Ionic HttpClient inject error

I'm new to Ionic and experiencing the following error when I inject HttpClient into my service class:
Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[CategoriesServiceProvider -> HttpClient]:
StaticInjectorError(Platform: core)[CategoriesServiceProvider -> HttpClient]:
NullInjectorError: No provider for HttpClient!
Error: StaticInjectorError(AppModule)[CategoriesServiceProvider -> HttpClient]:
StaticInjectorError(Platform: core)[CategoriesServiceProvider -> HttpClient]:
NullInjectorError: No provider for HttpClient!
The error is triggered by the following Service class:
import { HttpClient } from '#angular/common/http';
import { Injectable } from '#angular/core';
#Injectable()
export class CategoriesServiceProvider {
apiURL = 'https://randomuser.me/api/?results=10';
constructor(private http: HttpClient) {
console.log('Hello CategoriesServiceProvider Provider');
}
}
If I remove the HttpClient from the constructor, the error goes away.
And, the following is my app.module.ts code:
import { BrowserModule } from '#angular/platform-browser';
import { ErrorHandler, NgModule } from '#angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '#ionic-native/splash-screen';
import { StatusBar } from '#ionic-native/status-bar';
import { MyApp } from './app.component';
import { TabsPage } from '../pages/tabs/tabs';
import { CategoriesPage } from '../pages/categories/categories';
import { SubscriptionsPage } from '../pages/subscriptions/subscriptions';
import { CategoriesServiceProvider } from '../providers/categories-service/categories-service';
#NgModule({
declarations: [
MyApp,
TabsPage,
CategoriesPage,
SubscriptionsPage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
TabsPage,
CategoriesPage,
SubscriptionsPage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
CategoriesServiceProvider
]
})
export class AppModule {}
Any insights will be appreciated.
Add import { HttpClientModule } from '#angular/common/http'; in your app module.
In imports, add HttpClientModule like:
imports: [
BrowserModule,
HttpClientModule,
IonicModule.forRoot(MyApp)
]

Ionic 2 Cannot find module "#angular/common/http/src/headers"

I just started learning ionic and while implementing rest-service i am getting following error,
Error: Cannot find module "#angular/common/http/src/headers"
at Object.199 (http://localhost:8100/build/main.js:87:7)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.198 (http://localhost:8100/build/main.js:43:95)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.278 (http://localhost:8100/build/main.js:231:75)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.222 (http://localhost:8100/build/main.js:166:73)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
at Object.200 (http://localhost:8100/build/main.js:146:70)
at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
and my version details are,
Ionic Framwork: 3.9.2
Ionic App scripts :3.1.8
Angular Core:5.0.3
Node:6.9.4
Os Platform: windows 7
my package.json contains -
"dependencies": {
"#angular/common": "5.0.3",
"#angular/compiler": "5.0.3",
"#angular/compiler-cli": "5.0.3",
"#angular/core": "5.0.3",
"#angular/forms": "5.0.3",
"#angular/http": "5.0.3",
"#angular/platform-browser": "5.0.3",
"#angular/platform-browser-dynamic": "5.0.3",
"#ionic-native/core": "4.4.0",
"#ionic-native/http": "^4.5.3",
"#ionic-native/splash-screen": "4.4.0",
"#ionic-native/status-bar": "4.4.0",
"#ionic/storage": "2.1.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "3.1.8",
"typescript": "2.4.2"
}
app.module look like this,
import { BrowserModule } from '#angular/platform-browser';
import {HttpClientModule} from '#angular/common/http';
import { ErrorHandler, NgModule } from '#angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '#ionic-native/splash-screen';
import { StatusBar } from '#ionic-native/status-bar';
import { Http,HttpModule } from '#angular/http';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { RestServiceProvider } from '../providers/rest-service/rest-service';
#NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
HttpModule,
HttpClientModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
RestServiceProvider
]
})
export class AppModule {}
and last one my service look like this,
import { HttpClient } from '#angular/common/http';
import { Injectable } from '#angular/core';
import { HttpHeaders } from '#angular/common/http/src/headers';
/*
Generated class for the RestServiceProvider provider.
See https://angular.io/guide/dependency-injection for more info on providers
and Angular DI.
*/
#Injectable()
export class RestServiceProvider {
username:string;
password:string;
constructor(public http: HttpClient) {
console.log('Hello RestServiceProvider Provider');
}
load(){
let requestHeader=new HttpHeaders();
requestHeader.append("Content-Type","application/json");
let postParams={
UserName:this.username,
Password:this.password
}
return new Promise(resolve=>{
this.http.post("htttp/someservice", postParams,{headers:requestHeader})
.subscribe(data => {
alert(data);
}, error => {
console.log(error);// Error getting the data
});
});
}
}
looking for help. :-)
Change
import { HttpHeaders } from '#angular/common/http/src/headers';
to
import { HttpHeaders } from '#angular/common/http';

StaticInjectorError when adding simple provider to blank Ionic project and injecting into a component

I'm getting the following error when injecting a basic provider into the home page component of a blank Ionic project:
columnNumber: 19752
fileName: "http://localhost:8100/build/polyfills.js"
lineNumber: 3
message: "Uncaught (in promise): Error: StaticInjectorError[TestProvider]: \n StaticInjectorError[TestProvider]: \n NullInjectorError: No provider for TestProvider!\n_NullInjector.prototype.get#http://localhost:8100/build/vendor.js:1276:19\nresolveToken#http://localhost:8100/build/vendor.js:1564:17\ntryResolveToken#http://localhost:8100/build/vendor.js:1506:16\nStaticInjector.prototype.get#http://localhost:8100/build/vendor.js:1377:20\nresolveToken#http://localhost:8100/build/vendor.js:1564:17\ntryResolveToken#http://localhost:8100/build/vendor.js:1506:16\nStaticInjector.prototype.get#http://localhost:8100/build/vendor.js:1377:20\nresolveNgModuleDep#http://localhost:8100/build/vendor.js:10938:12\nNgModuleRef_.prototype.get#http://localhost:8100/build/vendor.js:12159:16\nresolveDep#http://localhost:8100/build/vendor.js:12655:12\ncreateClass#http://localhost:8100/build/vendor.js:12519:85\ncreateDirectiveInstance#http://localhost:8100/build/vendor.js:12364:37\ncreateViewNodes#http://localhost:8100/build/vendor.js:13802:53\ncreateRootView#http://localhost:8100/build/vendor.js:13692:5\ncallWithDebugContext#http://localhost:8100/build/vendor.js:15093:39\ndebugCreateRootView#http://localhost:8100/build/vendor.js:14394:12\nComponentFactory_.prototype.create#http://localhost:8100/build/vendor.js:11313:37\nComponentFactoryBoundToModule.prototype.create#http://localhost:8100/build/vendor.js:4275:16\nNavControllerBase.prototype._viewInit#http://localhost:8100/build/vendor.js:48293:27\nNavControllerBase.prototype._nextTrns/<#http://localhost:8100/build/vendor.js:48106:17\nF</l</t.prototype.invoke#http://localhost:8100/build/polyfills.js:3:14974\nonInvoke#http://localhost:8100/build/vendor.js:4982:24\nF</l</t.prototype.invoke#http://localhost:8100/build/polyfills.js:3:14901\nF</c</r.prototype.run#http://localhost:8100/build/polyfills.js:3:10124\nf/<#http://localhost:8100/build/polyfills.js:3:20240\nF</l</t.prototype.invokeTask#http://localhost:8100/build/polyfills.js:3:15649\nonInvokeTask#http://localhost:8100/build/vendor.js:4973:24\nF</l</t.prototype.invokeTask#http://localhost:8100/build/polyfills.js:3:15562\nF</c</r.prototype.runTask#http://localhost:8100/build/polyfills.js:3:10815\no#http://localhost:8100/build/polyfills.js:3:7887\n"
promise: Object { __zone_symbol__state: 0, __zone_symbol__value: Error }
rejection: Error: StaticInjectorError[TestProvider]:
StaticInjectorError[TestProvider]:
NullInjectorError: No provider for TestProvider!
Stack trace:
_NullInjector.prototype.get#http://localhost:8100/build/vendor.js:1276:19
resolveToken#http://localhost:8100/build/vendor.js:1564:17
tryResolveToken#http://localhost:8100/build/vendor.js:1506:16
StaticInjector.prototype.get#http://localhost:8100/build/vendor.js:1377:20
resolveToken#http://localhost:8100/build/vendor.js:1564:17
tryResolveToken#http://localhost:8100/build/vendor.js:1506:16
StaticInjector.prototype.get#http://localhost:8100/build/vendor.js:1377:20
resolveNgModuleDep#http://localhost:8100/build/vendor.js:10938:12
NgModuleRef_.prototype.get#http://localhost:8100/build/vendor.js:12159:16
resolveDep#http://localhost:8100/build/vendor.js:12655:12
createClass#http://localhost:8100/build/vendor.js:12519:85
createDirectiveInstance#http://localhost:8100/build/vendor.js:12364:37
createViewNodes#http://localhost:8100/build/vendor.js:13802:53
createRootView#http://localhost:8100/build/vendor.js:13692:5
callWithDebugContext#http://localhost:8100/build/vendor.js:15093:39
debugCreateRootView#http://localhost:8100/build/vendor.js:14394:12
ComponentFactory_.prototype.create#http://localhost:8100/build/vendor.js:11313:37
ComponentFactoryBoundToModule.prototype.create#http://localhost:8100/build/vendor.js:4275:16
NavControllerBase.prototype._viewInit#http://localhost:8100/build/vendor.js:48293:27
NavControllerBase.prototype._nextTrns/<#http://localhost:8100/build/vendor.js:48106:17
F</l</t.prototype.invoke#http://localhost:8100/build/polyfills.js:3:14974
onInvoke#http://localhost:8100/build/vendor.js:4982:24
F</l</t.prototype.invoke#http://localhost:8100/build/polyfills.js:3:14901
F</c</r.prototype.run#http://localhost:8100/build/polyfills.js:3:10124
f/<#http://localhost:8100/build/polyfills.js:3:20240
F</l</t.prototype.invokeTask#http://localhost:8100/build/polyfills.js:3:15649
onInvokeTask#http://localhost:8100/build/vendor.js:4973:24
F</l</t.prototype.invokeTask#http://localhost:8100/build/polyfills.js:3:15562
F</c</r.prototype.runTask#http://localhost:8100/build/polyfills.js:3:10815
o#http://localhost:8100/build/polyfills.js:3:7887
stack: "c#http://localhost:8100/build/polyfills.js:3:19752\nu/<#http://localhost:8100/build/polyfills.js:3:19174\nNavControllerBase.prototype._fireError#http://localhost:8100/build/vendor.js:48075:13\nNavControllerBase.prototype._failed#http://localhost:8100/build/vendor.js:48068:9\nNavControllerBase.prototype._nextTrns/<#http://localhost:8100/build/vendor.js:48115:53\nF</l</t.prototype.invoke#http://localhost:8100/build/polyfills.js:3:14974\nonInvoke#http://localhost:8100/build/vendor.js:4982:24\nF</l</t.prototype.invoke#http://localhost:8100/build/polyfills.js:3:14901\nF</c</r.prototype.run#http://localhost:8100/build/polyfills.js:3:10124\nf/<#http://localhost:8100/build/polyfills.js:3:20240\nF</l</t.prototype.invokeTask#http://localhost:8100/build/polyfills.js:3:15649\nonInvokeTask#http://localhost:8100/build/vendor.js:4973:24\nF</l</t.prototype.invokeTask#http://localhost:8100/build/polyfills.js:3:15562\nF</c</r.prototype.runTask#http://localhost:8100/build/polyfills.js:3:10815\no#http://localhost:8100/build/polyfills.js:3:7887\n"
task: Object { runCount: 0, _state: "notScheduled", type: "microTask", … }
zone: Object { _properties: {…}, _parent: {…}, _name: "angular", … }
__proto__: Object { … }
Steps to reproduce:
Create a test project. ionic start TestProject blank
Add a test provider. ionic generate provider TestProvider. The provider is added to the provider list in the app.module.
Inject the provider into the home page component, by importing TestProvider and injecting into the constructor.
Sometimes the error occurs; sometimes it doesn't. If it doesn't, create another provider and repeat the process until the error occurs.
At one point, I created three separate test providers with identical, copy/pasted code; one of them worked consistently, but the other two produced the StaticInjectorError.
TestProject/src/app/app.module.ts
import { BrowserModule } from '#angular/platform-browser';
import { ErrorHandler, NgModule } from '#angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '#ionic-native/splash-screen';
import { StatusBar } from '#ionic-native/status-bar';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { TestProvider } from '../providers/test/test';
#NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
TestProvider
]
})
export class AppModule {}
TestProject/src/pages/home/home.ts
import { Component } from '#angular/core';
import { NavController } from 'ionic-angular';
import { TestProvider } from '../../providers/test/test';
#Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController, public test: TestProvider ) {
}
}
TestProject/src/providers/test/test.js
import { Injectable } from '#angular/core';
#Injectable()
export class TestProvider {
constructor() {
console.log('Hello TestProvider Provider');
}
}
package.json
{
"name": "ProviderNamingBug",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "5.0.3",
"#angular/compiler": "5.0.3",
"#angular/compiler-cli": "5.0.3",
"#angular/core": "5.0.3",
"#angular/forms": "5.0.3",
"#angular/http": "5.0.3",
"#angular/platform-browser": "5.0.3",
"#angular/platform-browser-dynamic": "5.0.3",
"#ionic-native/core": "4.4.0",
"#ionic-native/splash-screen": "4.4.0",
"#ionic-native/status-bar": "4.4.0",
"#ionic/storage": "2.1.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "3.1.8",
"typescript": "2.4.2"
},
"description": "An Ionic project"
}
I'm running on Windows 10, with Node.js version 8.9.4 and npm version 5.6.0.
Any help would be greatly appreciated.

ionic: module has no exported member

I am a newbie of ionic framework, just started now. I am working on windows. I created my app with this command:
ionic start ionic-welcome tabs
ionic serve
I create a new page with below command
ionic g page welcome
I get this response in my console:
[OK] Generated a page named welcome!
updated app.module.ts for welcome page:
import { NgModule, ErrorHandler } from '#angular/core';
import { BrowserModule } from '#angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { Welcome } from '../pages/welcome/welcome';
import { AboutPage } from '../pages/about/about';
import { ContactPage } from '../pages/contact/contact';
import { HomePage } from '../pages/home/home';
import { TabsPage } from '../pages/tabs/tabs';
import { StatusBar } from '#ionic-native/status-bar';
import { SplashScreen } from '#ionic-native/splash-screen';
#NgModule({
declarations: [
MyApp,
Welcome,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
Welcome,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
But when i browse to localhost:8100 i am getting this error for "welcome page".
Module
'"C:/xampp/htdocs/ionic/ionic-welcome/src/pages/welcome/welcome"' has
no exported member 'Welcome'.
package.json:
{
"name": "ionic-welcome",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "4.1.3",
"#angular/compiler": "4.1.3",
"#angular/compiler-cli": "4.1.3",
"#angular/core": "4.1.3",
"#angular/forms": "4.1.3",
"#angular/http": "4.1.3",
"#angular/platform-browser": "4.1.3",
"#angular/platform-browser-dynamic": "4.1.3",
"#ionic-native/core": "3.12.1",
"#ionic-native/splash-screen": "3.12.1",
"#ionic-native/status-bar": "3.12.1",
"#ionic/storage": "2.0.1",
"ionic-angular": "3.6.0",
"ionicons": "3.0.0",
"rxjs": "5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
"devDependencies": {
"#ionic/app-scripts": "2.1.3",
"typescript": "2.3.4"
},
"description": "An Ionic project"
}
Some says to remove '^' character from package.json but don't have one. I am out of options don't know what to do next, please help.
if you check Welcome.ts you probably find something like this
export class WelcomePage {
constructor(public navCtrl: NavController, public navParams: NavParams)
{
}
ionViewDidLoad() {
console.log('ionViewDidLoad WelcomePage');
}
in your app.modules.ts do the following
import { WelcomePage } from '../pages/welcome/welcome'
then add WelcomePage to declarations and entryComponents.
i just faced this problem and managed to solve it this way.
Good luck