1

I just updated all my dependencies for a project after a long time ago.

After the updates i had this problem here: "export 'DOCUMENT' was not found in '@angular/platform-browser' I did the "workaround" mentioned in the comments (editing files in the node_modules folder) but now the app crashes with a different error...

I'm having similar problems mentioned and remaining unanswered in this topic: https://forum.ionicframework.com/t/error-in-ios-emulator/122022

I'm getting the following error after running either ionic serve or ionic cordova emulate ios -lcs --prod

Unhandled Promise rejection: – "undefined is not an object (evaluating 'win['Ionic']')" – "; Zone:" – "<root>" – "; Task:" – "Promise.then" – "; Value:" (2)
TypeError: undefined is not an object (evaluating 'win['Ionic']')

"setupConfig@http://localhost:8100/build/vendor.js:31748:23
_createProviderInstance@http://localhost:8100/build/vendor.js:20787:38
initNgModule@http://localhost:8100/build/vendor.js:20717:55
NgModuleRef_@http://localhost:8100/build/vendor.js:21426:21
createNgModuleRef@http://localhost:8100/build/vendor.js:21415:28
http://localhost:8100/build/vendor.js:27281:49
  onInvoke@http://localhost:8100/build/vendor.js:26789:39
run@http://localhost:8100/build/polyfills.js:3:10149
run@http://localhost:8100/build/polyfills.js:3:10149
http://localhost:8100/build/polyfills.js:3:20245
  runTask@http://localhost:8100/build/polyfills.js:3:10844
o@http://localhost:8100/build/polyfills.js:3:7901
promiseReactionJob@[native code]"

The ionic info command returns the following:

Ionic:

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

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0, ios 5.0.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 14 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.9 

System:

   Android SDK Tools : 26.1.1 
   ios-sim           : 8.0.2
   NodeJS            : v8.11.2 
   npm               : 6.12.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.3 Build version 10G8

And I have the following dependencies installed

"@angular/animations": "^8.2.11",
    "@angular/common": "^8.2.11",
    "@angular/compiler": "^8.2.11",
    "@angular/compiler-cli": "^8.2.11",
    "@angular/core": "^8.2.11",
    "@angular/forms": "^8.2.11",
    "@angular/http": "^7.2.15",
    "@angular/platform-browser": "^8.2.11",
    "@angular/platform-browser-dynamic": "^8.2.11",
    "@ionic-native/action-sheet": "^5.15.1",
    "@ionic-native/base64": "^5.15.1",
    "@ionic-native/camera": "^5.15.1",
    "@ionic-native/core": "^5.15.1",
    "@ionic-native/dialogs": "^5.15.1",
    "@ionic-native/facebook": "^5.15.1",
    "@ionic-native/google-plus": "^5.15.1",
    "@ionic-native/http": "^5.15.1",
    "@ionic-native/keyboard": "^5.15.1",
    "@ionic-native/network": "^5.15.1",
    "@ionic-native/screen-orientation": "^5.15.1",
    "@ionic-native/splash-screen": "^5.15.1",
    "@ionic-native/status-bar": "^5.15.1",
    "@ionic/storage": "^2.2.0",
    "com-badrit-base64": "^0.2.0",
    "cordova-android": "^8.1.0",
    "cordova-ios": "^5.0.1",
    "cordova-plugin-actionsheet": "^2.3.3",
    "cordova-plugin-advanced-http": "^2.2.0",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-dialogs": "^2.0.2",
    "cordova-plugin-facebook4": "^6.2.0",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-googleplus": "^8.1.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.1.2",
    "cordova-plugin-nativestorage": "^2.3.2",
    "cordova-plugin-network-information": "^2.0.2",
    "cordova-plugin-screen-orientation": "^3.0.2",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-sqlite-storage": "^3.4.0",
    "es6-promise-plugin": "^4.2.2",
    "ionic-angular": "^3.9.9",
    "ionicons": "4.6.3",
    "rxjs": "^6.5.3",
    "rxjs-compat": "^6.5.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "^0.10.2"
Sanyos
  • 41
  • 3
  • editing files in node_modules is not a good option, try `npm install` after removing node_modules folder and also try to remove platform where you are facing issue and then try to add that platform again – Muhammad Awais Oct 21 '19 at 16:15
  • Yes i know that editing node modules is not a good workaround. See the linked stack overflow topic why i did that....This: https://stackoverflow.com/questions/56826692/export-document-was-not-found-in-angular-platform-browser As i figure, the error in the question has nothing to do with this. Also tried removing all the platforms then reinstalling them it not worked.Still getting the same error. – Sanyos Oct 21 '19 at 16:34

0 Answers0