ionic 5 production build failing - ionic-framework

I just upgraded to ionic 5 -- and my prod build fails with the following:
ERROR in ./node_modules/#ionic/angular/fesm2015/ionic-angular.js
Module build failed (from ./node_modules/#angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'kind' of undefined
Debug build works well.

To fix this,
Make sure your dependencies are
dependencies:
"#angular/common": "8.2.13",
"#angular/core": "8.2.13",
"#angular/forms": "8.2.13",
"#angular/platform-browser": "8.2.13",
"#angular/platform-browser-dynamic": "8.2.13",
"#angular/pwa": "^0.803.23",
"#angular/router": "8.2.13",
"#angular/service-worker": "^8.2.14",
dev dependencies:
"#angular-devkit/architect": "^0.803.23",
"#angular-devkit/build-angular": "^0.803.23",
"#angular-devkit/core": "^8.3.23",
"#angular-devkit/schematics": "^8.3.23",
"#angular/cli": "^8.3.23",
"#angular/compiler": "8.2.13",
"#angular/compiler-cli": "8.2.13",
"#angular/language-service": "^8.2.14",
"#ionic/angular-toolkit": "^2.1.2",
specifically note, 8.2.13 for angular instead of 8.1 that I had.
Also take a look at:
https://github.com/ionic-team/ionic/issues/20341

Related

Working example of #nativescript/firebase-firestore

I am trying to use the #nativescript/firebase-firestore and #nativescript/firebase-core plugin from Nativescript in my Nativescript angular project.
I ran
npm install #nativescript/firebase-core
npm install #nativescript/firebase-firestore
and put this code to my blank native script angular project.
import { firebase } from '#nativescript/firebase-core'
import '#nativescript/firebase-firestore'
const firestore = firebase().firestore()
I was not able to make this work for IOS due to some compatibility issues.
My questions : Has anybody put this to work and could provide me a working example?
Here is my package.json :
{
"name": "fb3",
"main": "./src/main.ts",
"version": "1.0.0",
"private": true,
"dependencies": {
"#angular/animations": "~15.0.0",
"#angular/common": "~15.0.0",
"#angular/compiler": "~15.0.0",
"#angular/core": "~15.0.0",
"#angular/forms": "~15.0.0",
"#angular/platform-browser": "~15.0.0",
"#angular/platform-browser-dynamic": "~15.0.0",
"#angular/router": "~15.0.0",
"#nativescript/angular": "~15.0.0",
"#nativescript/core": "~8.4.0",
"#nativescript/firebase-core": "^2.5.2",
"#nativescript/firebase-firestore": "^2.5.2",
"#nativescript/theme": "~3.0.2",
"rxjs": "~7.5.0",
"zone.js": "~0.11.5"
},
"devDependencies": {
"#angular-devkit/build-angular": "~15.0.0",
"#angular/compiler-cli": "~15.0.0",
"#nativescript/ios": "8.3.3",
"#nativescript/types": "~8.4.0",
"#nativescript/webpack": "~5.0.12",
"#ngtools/webpack": "~15.0.0",
"typescript": "~4.8.4"
}
}
It seems that there are issues with min required iOS version is 11.0 so I added
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
to my build.xcconfig.

RxJS module give error after update. how to solve?

In my angular 5 project. My imports have been producing weird errors that I cant remember having a few days ago. For the import here below it says: "module ...rxjs/observable has no exported member observable".
import { Observable } from 'rxjs/Observable';
I did not have this before.
Funny thing is however, the angular website, including the functionality with the observable, works just fine
Here is my package.json:
"private": true,
"dependencies": {
"#angular-devkit/core": "0.0.29",
"#angular/animations": "^5.2.0",
"#angular/cdk": "^5.2.5",
"#angular/common": "^5.2.0",
"#angular/compiler": "^5.2.0",
"#angular/core": "^5.2.0",
"#angular/forms": "^5.2.0",
"#angular/material": "^5.2.0",
"#angular/material-moment-adapter": "^5.2.5",
"#angular/platform-browser": "^5.2.0",
"#angular/platform-browser-dynamic": "^5.2.0",
"#angular/router": "^5.2.0",
"bootstrap": "^4.0.0",
"core-js": "^2.4.1",
"jsonwebtoken": "^8.2.0",
"moment": "^2.20.1",
"moment-duration-format": "^2.2.2",
"npm": "^5.6.0",
"rxjs": "^5.5.12",
"zone.js": "^0.8.19"
},
Unfortunately, I do not know how to solve the import problem. However, I think it might be worth mentioning that I experienced a similar issue when updating to the latest version for Angular 6, that is to say rxjs 6.3.0. So I downgraded to 6.2.1, which made the import errors go away.

How to stop ionic cordova run android command delete existing ionic apps on the device

I'm new to the forum and need help on running/installing ionic 3 app on a real device.
This command: ionic cordova run android (in my case) will delete the existing ionic app being installed on the device even though the app names are different.
I'd tried using ionic cordova run android --prod --release but the result is the same, i.e. Only ONE ionic app will be installed on the Android device which doesn't sound right.
Is there a way to prevent that from happening? Any options? Below is my package.json file:
"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/pro": "1.0.16",
"#ionic/storage": "2.1.3",
"cordova-android": "6.3.0",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-whitelist": "^1.3.1",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
Have you changed the package name of that App? This issue happened when package name of Apps are same.

Error While Adding New Provider in ionic

When i try to add a new provider to my existing ionic project it throws
The generate command is only available for projects t
hat use ionic-angular >= 3.0.0
I tried the following command to upgrade but it doesn't worked out
>npm install --save ionic-angular
My Ionic Version is 3.2.0
My Package.json looks
"dependencies": {
"#angular/common": "2.4.8",
"#angular/compiler": "2.4.8",
"#angular/compiler-cli": "2.4.8",
"#angular/core": "2.4.8",
"#angular/forms": "2.4.8",
"#angular/http": "2.4.8",
"#angular/platform-browser": "2.4.8",
"#angular/platform-browser-dynamic": "2.4.8",
"#angular/platform-server": "2.4.8",
"#angular/tsc-wrapped": "~0.5.2",
"#ionic/storage": "2.0.0",
"ionic-angular": "^2.3.0",
"ionic-native": "2.4.1",
"ionicons": "3.0.0",
"lodash-es": "^4.17.4",
"node-uuid": "^1.4.7",
"rxjs": "5.0.1",
"sw-toolbox": "3.4.0",
"uuid": "^2.0.2",
"zone.js": "0.7.2"
}

create project in ionic with --v2 and framework are 3

I created a project with
ionic start navigationAppv2 blank --v2
but when I use ionic info say:
Ionic Framework Version: 3.0.0
how can I solve this?
Not sure what you mean but I suspect you want to downgrade your Ionic framework version? If so, you just need to update your package.json to "ionic-angular": "2.3.0" for instance. The below is an extract of my package.json file running on the latest v2 version:
"#angular/common": "2.4.8",
"#angular/compiler": "2.4.8",
"#angular/compiler-cli": "2.4.8",
"#angular/core": "2.4.8",
"#angular/forms": "2.4.8",
"#angular/http": "2.4.8",
"#angular/platform-browser": "2.4.8",
"#angular/platform-browser-dynamic": "2.4.8",
"#angular/platform-server": "2.4.8",
"#ionic-native/core": "3.4.4",
"#ionic-native/device": "3.4.4",
"#ionic-native/in-app-browser": "3.4.4",
"#ionic-native/local-notifications": "3.4.4",
"#ionic-native/splash-screen": "3.4.4",
"#ionic-native/status-bar": "3.4.4",
"#ionic/storage": "2.0.0",
"ionic-angular": "2.3.0"