Open mubasshir opened 6 years ago
The discussion here suggests to remove any usage of Page
.
Example: Turn let page : Page;
into let page;
This seems to work for me.
What fixed this issue for us was to make sure all the import statements are from ionic-angular
as suggested here.
import { LoadingController } from 'ionic-angular'
import { LoadingController } from 'ionic-angular/components/loading/loading-controller'
Then we were able to bump typescript
to latest (3.1.1
) with no issues.
The discussion here suggests to remove any usage of
Page
.Example: Turn
let page : Page;
intolet page;
This seems to work for me.
Thanks for this man! Also I would like to add Remove page import from all the components
import { Page } from 'ionic-angular/umd/navigation/nav-util';
In my case changing the import:
import { Page } from 'ionic-angular/umd/navigation/nav-util';
into:
import { Page } from 'ionic-angular/navigation/nav-util';
was enough to get rid of the error
I have the same problem but i could not identify where the is problem.In my case 70 components are there.Can anybody tell solution to my problem ?.
app-scripts= "3.2.2",
typescript = "3.2.4"
Unfortunately, no.
In my case changing the import:
import { Page } from 'ionic-angular/umd/navigation/nav-util';
into:
import { Page } from 'ionic-angular/navigation/nav-util';
was enough to get rid of the error
This worked for me. Thanks!
It's so frustrating that I still have this issue, even after trying above all.
[12:06:34] typescript error
Cannot determine the module for class OverlayPortal in
/Users/mubasshir/Documents/ionic/App/node_modules/ionic-angular/components/app/overlay-portal.d.ts! Add
OverlayPortal to the NgModule to fix it. Cannot determine the module for class IonicApp in
/Users/mubasshir/Documents/ionic/App/node_modules/ionic-angular/components/app/app-root.d.ts! Add IonicApp
to the NgModule to fix it. Cannot determine the module for class ClickBlock in
/Users/mubasshir/Documents/ionic/App/node_modules/ionic-angular/components/app/click-block.d.ts! Add
ClickBlock to the NgModule to fix it.
[12:06:34] ionic-app-script task: "build"
[12:06:34] Error: The Angular AoT build failed. See the issues above
Error: The Angular AoT build failed. See the issues above
at /Users/mubasshir/Documents/ionic/App/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:237:55
at step (/Users/mubasshir/Documents/ionic/App/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
at Object.next (/Users/mubasshir/Documents/ionic/App/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
at fulfilled (/Users/mubasshir/Documents/ionic/App/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
[ERROR] An error occurred while running subprocess ionic-app-scripts.
@mubasshir try to use typescript 2.8.1
If can help someone, I remove my 'Page' in my code but I forget to remove the line in the import section.
@mubasshir try to use typescript 2.8.1
Thanks @alexsherekin, this seems to fix my problem (changing Page
s and import
s did not do it for me). Any idea why that works ? I'm just wondering how long I'll be able to hold this precise version before other problems start to popup.
i solve my problem. in my project i was using an outdated module, ion-datepicker
if you are also using same issue, here are some steps, you can follow and find your infected or outdated module.
1. Step one:
in your project find in all files
from 'ionic-angular/
word,
if you find this word like
import { xyz } from 'ionic-angular/xyz/abc'
update that module.
if no update available then you can remove that module
npm uninstall ion-datepicker(or your defected module)
after this you needs to remove that module from app.module.ts
and where ever you are using remove from there, after that you can try
ionic cordova build android --prod --release
hope this will help. Thanks
@webumer no ion-datepicker. btw how did you find this out?
@mubasshir remove this type headers. import { Page } from 'ionic-angular/umd/navigation/nav-util';
Thanks for revert but I've tried anything mentioned everywhere else including removal of header
but still this problem exists.
This is the reason, I'm moving away from Ionic to Flutter.
Sadly sayin that this is driving me crazy since over a week now... I tried nearly everything i found on google and StackOverflow, cleaned code, go step by step to each import, tried differnt TS Version etc etc... but still no luck....
here is my package.json:
{ "name": "App", "version": "3.0.0", "author": "Me", "homepage": "", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "lint": "ionic-app-scripts lint", "ionic:build": "node --max-old-space-size=8192 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build", "ionic:serve": "ionic-app-scripts serve" }, "dependencies": { "@angular-devkit/build-optimizer": "^0.13.4", "@angular/common": "5.2.9", "@angular/compiler": "5.2.9", "@angular/compiler-cli": "5.2.9", "@angular/core": "5.2.9", "@angular/fire": "^5.2.1", "@angular/forms": "5.2.9", "@angular/http": "5.1.2", "@angular/platform-browser": "5.2.9", "@angular/platform-browser-dynamic": "5.2.9", "@firebase/polyfill": "^0.3.4", "@ionic-native/action-sheet": "^4.20.0", "@ionic-native/admob-pro": "^4.20.0", "@ionic-native/app-rate": "^4.20.0", "@ionic-native/app-version": "^4.20.0", "@ionic-native/background-mode": "^4.20.0", "@ionic-native/badge": "^4.20.0", "@ionic-native/base64": "^4.20.0", "@ionic-native/call-number": "^4.20.0", "@ionic-native/camera": "^4.20.0", "@ionic-native/camera-preview": "^4.20.0", "@ionic-native/clipboard": "^4.20.0", "@ionic-native/core": "^4.20.0", "@ionic-native/crop": "4.5.2", "@ionic-native/device": "^4.20.0", "@ionic-native/email-composer": "4.5.2", "@ionic-native/facebook": "4.5.2", "@ionic-native/file-path": "^4.20.0", "@ionic-native/file-transfer": "^4.20.0", "@ionic-native/firebase": "^4.20.0", "@ionic-native/geolocation": "4.5.2", "@ionic-native/globalization": "^4.20.0", "@ionic-native/google-plus": "4.5.2", "@ionic-native/image-picker": "^4.20.0", "@ionic-native/image-resizer": "^4.20.0", "@ionic-native/in-app-browser": "4.5.2", "@ionic-native/in-app-purchase": "^4.20.0", "@ionic-native/in-app-purchase-2": "^4.20.0", "@ionic-native/keyboard": "4.5.2", "@ionic-native/media-capture": "^4.20.0", "@ionic-native/native-storage": "4.5.2", "@ionic-native/network": "^4.20.0", "@ionic-native/open-native-settings": "^4.20.0", "@ionic-native/photo-viewer": "^4.20.0", "@ionic-native/sim": "^4.20.0", "@ionic-native/social-sharing": "^4.20.0", "@ionic-native/splash-screen": "4.5.2", "@ionic-native/status-bar": "4.5.2", "@ionic-native/twitter-connect": "4.5.2", "@ionic-native/video-editor": "^4.20.0", "@ionic/storage": "^2.2.0", "@ngx-translate/core": "^9.1.1", "@ngx-translate/http-loader": "^2.0.1", "@types/core-js": "0.9.41", "@types/cropperjs": "^1.1.5", "@types/googlemaps": "3.25.38", "angular-cropperjs": "^0.1.5", "angular2-text-mask": "8.0.4", "bourbon": "5.0.0", "call-number": "0.0.2", "com-badrit-base64": "^0.2.0", "cordova-admobsdk": "^7.49.0", "cordova-android": "8.1.0", "cordova-android-support-gradle-release": "^3.0.1", "cordova-browser": "5.0.4", "cordova-clipboard": "^1.3.0", "cordova-ios": "5.0.1", "cordova-lib": "^9.0.1", "cordova-open-native-settings": "^1.5.2", "cordova-plugin-actionsheet": "^2.3.3", "cordova-plugin-add-swift-support": "^1.7.2", "cordova-plugin-admobpro": "^2.49.0", "cordova-plugin-app-version": "^0.1.9", "cordova-plugin-apprate": "^1.4.0", "cordova-plugin-camera": "^4.1.0", "cordova-plugin-camera-preview": "^0.11.0", "cordova-plugin-crop": "^0.4.0", "cordova-plugin-device": "^2.0.3", "cordova-plugin-dialogs": "^2.0.2", "cordova-plugin-email-composer": "^0.8.15", "cordova-plugin-extension": "^1.5.4", "cordova-plugin-facebook4": "^1.10.1", "cordova-plugin-file": "^6.0.2", "cordova-plugin-file-transfer": "^1.7.1", "cordova-plugin-filepath": "^1.5.6", "cordova-plugin-firebase-lib": "^3.3.0", "cordova-plugin-geolocation": "^4.0.2", "cordova-plugin-globalization": "^1.11.0", "cordova-plugin-googleplus": "^5.3.2", "cordova-plugin-inappbrowser": "^1.7.2", "cordova-plugin-ionic": "^2.0.4", "cordova-plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-webview": "^1.2.1", "cordova-plugin-localization-strings": "^3.2.0", "cordova-plugin-media-capture": "^3.0.3", "cordova-plugin-nativestorage": "^2.3.2", "cordova-plugin-network-information": "^2.0.2", "cordova-plugin-purchase": "^8.1.1", "cordova-plugin-sim": "^1.3.3", "cordova-plugin-splashscreen": "^4.1.0", "cordova-plugin-statusbar": "^2.4.3", "cordova-plugin-telerik-imagepicker": "^2.3.3", "cordova-plugin-video-editor": "^1.1.3", "cordova-plugin-whitelist": "^1.3.4", "cordova-plugin-x-socialsharing": "^5.6.0", "cordova-sqlite-storage": "^2.6.0", "emoji.json": "^12.0.0", "es6-promise-plugin": "^4.2.2", "exif-js": "^2.3.0", "firebase": "^6.4.2", "google-libphonenumber": "3.0.9", "info.protonet.imageresizer": "^0.1.1", "ionic-angular": "^3.9.8", "ionic-long-press": "^1.5.0", "ionic3-image-cache": "^0.1.4", "ionicons": "3.0.0", "konva": "^3.3.3", "list": "2.0.18", "moment": "^2.24.0", "mx.ferreyra.callnumber": "0.0.2", "ng2-konva": "^6.0.0", "ngx-image-cropper": "^1.3.10", "ngx-moment": "^3.4.0", "rxjs": "^6.5.2", "rxjs-compat": "^6.5.2", "sw-toolbox": "3.6.0", "text-mask-addons": "3.5.1", "time-ago-pipe": "^1.3.2", "time-ago-web-component": "^1.2.2", "videogular2": "6.0.1", "zone.js": "0.8.18", "zuck.js": "^1.3.0" }, "devDependencies": { "@ionic/app-scripts": "^3.2.1", "typescript": "^3.5.2" }, "description": "An Ionic project", "cordova": { "plugins": { "cordova-plugin-splashscreen": {}, "cordova-plugin-statusbar": {}, "cordova-plugin-whitelist": {}, "cordova-plugin-inappbrowser": {}, "cordova-plugin-nativestorage": {}, "cordova-plugin-x-socialsharing": { "ANDROID_SUPPORT_V4_VERSION": "24.1.1+", "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.", "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly." }, "cordova-plugin-email-composer": {}, "mx.ferreyra.callnumber": {}, "call-number": {}, "com-badrit-base64": {}, "cordova-plugin-file": {}, "cordova-plugin-ionic-keyboard": {}, "cordova-sqlite-storage": {}, "cordova-plugin-geolocation": {}, "cordova-plugin-dialogs": {}, "cordova-plugin-globalization": {}, "cordova-admobsdk": {}, "cordova-plugin-device": {}, "cordova-plugin-sim": {}, "cordova-plugin-apprate": {}, "cordova-plugin-app-version": {}, "cordova-plugin-camera": { "ANDROID_SUPPORT_V4_VERSION": "27.+" }, "cordova-open-native-settings": {}, "cordova-clipboard": {}, "cordova-plugin-file-transfer": {}, "cordova-plugin-ionic-webview": {}, "cordova-plugin-firebase-lib": {}, "cordova-plugin-facebook4": { "APP_ID": "erererer", "APP_NAME": "erererer" }, "cordova-plugin-purchase": { "BILLING_KEY": "" }, "cordova-plugin-media-capture": {}, "cordova-plugin-video-editor": {}, "cordova-plugin-actionsheet": {}, "info.protonet.imageresizer": {}, "cordova-plugin-camera-preview": { "ANDROID_SUPPORT_LIBRARY_VERSION": "26+" }, "cordova-plugin-filepath": {}, "cordova-plugin-telerik-imagepicker": { "PHOTO_LIBRARY_USAGE_DESCRIPTION": " " }, "cordova-android-support-gradle-release": { "ANDROID_SUPPORT_VERSION": "27.+" }, "cordova-plugin-crop": {}, "cordova-plugin-network-information": {}, "cordova-plugin-localization-strings": { "TRANSLATION_PATH": "translations/app/" }, "cordova-plugin-admobpro": { "PLAY_SERVICES_VERSION": "16.0.0", "ADMOB_APP_ID": "" } }, "platforms": [ "browser", "ios", "android" ] }, "config": { "ionic_copy": "./config/copy.config.js" } }
and my ionic info:
`Ionic:
Ionic CLI : 5.0.2 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.8 @ionic/app-scripts : 3.2.1
Cordova:
Cordova CLI : 7.1.0 Cordova Platforms : android 8.1.0, ios 5.0.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 1.2.1, (and 32 other plugins)
Utility:
cordova-res : 0.3.0 native-run : 0.2.7
System:
ios-deploy : 1.9.2 ios-sim : 8.0.2 NodeJS : v10.16.0 (/usr/local/bin/node) npm : 6.9.0 OS : macOS Mojave Xcode : Xcode 11.0 Build version 11A420a `
if anybody has an idea it would the greatest....
best regards
Note: for support questions, please use one of these channels:
Short description of the problem:
not able to build prod version of any app
What behavior are you expecting?
Steps to reproduce:
Which @ionic/app-scripts version are you using? 3.1.11
ionic info
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc) Error
package.json