Upgrade from version 2.3.0 to 3.4.2 results in Runtime Error


#1

Hi, I updated my Project from Version 2.3.0 to 3.4.2.
When I call “ionic serve” it compiles and starts successful.
When I navigate to it in the browser I get the following message:

Error: Cannot find module "@angular/common/src/facade/lang"
    at Object.<anonymous> (http://localhost:8100/build/main.js:21340:7)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at Object.<anonymous> (http://localhost:8100/build/main.js:57704:105)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at Object.<anonymous> (http://localhost:8100/build/main.js:29369:92)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at Object.<anonymous> (http://localhost:8100/build/main.js:20690:87)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at Object.<anonymous> (http://localhost:8100/build/main.js:68667:94)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)

My “ionic info” output is followed by a snipped from my package.json file.

global packages:

    @ionic/cli-utils : 1.4.0
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Ionic Framework                 : ionic-angular 3.4.2

System:

    Node       : v7.10.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b 
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 4.2.0 

package.json

  "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",
		"@angular/platform-server": "4.1.3",
    "@ionic-native/app-version": "^3.4.4",
    "@ionic-native/camera": "3.12.1",
    "@ionic-native/core": "3.10.2",
    "@ionic-native/date-picker": "^3.4.4",
    "@ionic-native/device": "^3.4.4",
    "@ionic-native/dialogs": "^3.4.4",
    "@ionic-native/file": "^3.4.4",
    "@ionic-native/file-opener": "^3.4.4",
    "@ionic-native/geolocation": "^3.4.4",
    "@ionic-native/in-app-browser": "^3.2.1",
    "@ionic-native/keyboard": "^3.4.4",
    "@ionic-native/launch-navigator": "^3.2.1",
    "@ionic-native/network": "^3.2.1",
    "@ionic-native/photo-viewer": "^3.2.1",
    "@ionic-native/splash-screen": "3.10.2",
    "@ionic-native/status-bar": "3.10.2",
    "@ionic-native/transfer": "^3.4.4",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.4.2",
    "ionicons": "3.0.0",
    "moment": "^2.18.1",
    "ng2-charts": "1.3.0",
    "ng2-fittext": "1.0.12",
    "pouchdb": "6.1.2",
    "rxjs": "5.4.0",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^1.3.7",
    "@ionic/cli-plugin-ionic-angular": "1.3.1",
    "typescript": "2.3.3",
    "xml2js": "0.4.17"
  },
  "cordovaPlugins": [
    "com-sarriaroman-photoviewer",
    "cordova-plugin-app-version",
    "cordova-plugin-camera",
    "cordova-plugin-console",
    "cordova-plugin-datepicker",
    "cordova-plugin-dialogs",
    "cordova-plugin-device",
    "cordova-plugin-file",
    "cordova-plugin-file-opener2",
    "cordova-plugin-geolocation",
    "cordova-plugin-inappbrowser",
    "cordova-plugin-network-information",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "cordova-plugin-whitelist",
    "uk.co.workingedge.phonegap.plugin.launchnavigator",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    },
    "android"
  ]

If I start a new Project everything works fine, so it presume it is something with a dependency.
Can anyone please help me and thanks for reading and thinking about the problem.

Greetings,
Camillo Jaeger


#2

Are you manually importing that module (or something similar) in your code?


#3

Not that I know of since this module is never mentioned in my code.
Here is my app.module.ts

const APP_CONFIG = {
	prodMode: true,
	platforms: {
		ios: {
			backButtonText: "",
			scrollAssist: false,
			autoFocusAssist: false
		},
		android: {
//			tabsPlacement: 'top',
			tabsHideOnSubPages: true,
			scrollAssist: false,
			autoFocusAssist: false
		}
	}
};

@NgModule({
	declarations: [
		EgeckoMobileApp,
		//PAGES
		//PIPES
		//COMPONENTS
	],
	imports: [
		Ng2FittextModule,
		BrowserModule,
		HttpModule,
		ChartsModule,
		IonicModule.forRoot(EgeckoMobileApp, APP_CONFIG)
	],
	bootstrap: [IonicApp],
	entryComponents: [
		EgeckoMobileApp,
		... my pages ...
	],
	providers: [
		{provide: ErrorHandler, useClass: IonicErrorHandler},
		... my providers ...
		Transfer,
		Network,
		Camera,
		Device,
		DatePicker,
		InAppBrowser,
		PhotoViewer,
		LaunchNavigator,
		Keyboard,
		SplashScreen,
		StatusBar,
		AppVersion,
		Dialogs,
		Geolocation,
		File,
		FileOpener,
	]
})
export class AppModule {
}


#4

OK, I searched again and found 2 files where

import { isPresent } from "@angular/common/src/facade/lang";

was written.
I don’t know why I didn’t find them when I searched earlier (must have had some char wrong).

After removing those it worked.

THANKS