Ionic 2 serve problem - Class 'RuntimeCompiler' incorrectly implements interface 'Compiler'


#1

Hi everyone!!! I updated my last version of Ionic, and when I try to serve the project, I got the following error:

[00:09:44] transpile started …
[00:09:51] typescript: node_modules/@angular/compiler/src/runtime_compiler.d.ts, line: 26
Class ‘RuntimeCompiler’ incorrectly implements interface ‘Compiler’. Property ‘getNgContentSelectors’ is
missing in type ‘RuntimeCompiler’.

  L25:  private _ngModuleCompiler;
  L26:  private _directiveWrapperCompiler;
  L27:  private _compilerConfig;

[00:09:51] transpile failed


Thank you for your time!!!
Regards
Armando


Your system information:

Cordova CLI: Not installed
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.4
OS: macOS Sierra
Node Version: v7.2.1
Xcode version: Xcode 7.2 Build version 7C68


#2

Would you please show your package.json? I suspect you’re trying to use a more recent version of angular that is not compatible with Ionic.


#3

package.json

{
“name”: “my-app”,
“description”: “Description App”,
“homepage”: “https://app.com”,
“private”: true,
“scripts”: {
“build”: “ionic-app-scripts build”,
“watch”: “ionic-app-scripts watch”,
“serve:before”: “watch”,
“emulate:before”: “build”,
“deploy:before”: “build”,
“build:before”: “build”,
“run:before”: “build”
},
“dependencies”: {
"@ionic/storage": “^1.0.3”,
“datepicker-ionic2”: “^2.2.1”,
“ionic-angular”: “^2.0.0”,
“ionic-native”: “^2.0.3”,
“ionicons”: “^3.0.0”,
“moment”: “^2.15.1”,
“socket.io-client”: “^1.4.8”
},
“devDependencies”: {
"@ionic/app-scripts": “^1.0.0”,
"@types/lodash": “4.14.37”,
“typescript”: “^2.0.3”
},
“cordovaPlugins”: [
“cordova-plugin-device”,
“cordova-plugin-console”,
“cordova-plugin-whitelist”,
“cordova-plugin-splashscreen”,
“cordova-plugin-statusbar”,
“ionic-plugin-keyboard”
],
“cordovaPlatforms”: [
“ios”,
{
“platform”: “ios”,
“version”: “”,
“locator”: “ios”
}
]
}


#4

I run npm install -g angular-cli

And works!

With multiple versions of all, and upgrades, this things happen!


#5

I’ve done what @armandof suggests but i still get this error.
Any hint?


#6

I started an android project many weeks ago with this configuration

ordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 8.1
Node Version: v6.5.0
Xcode version: Not installed

Now I have to deploy with iOS and I have this configuration

Cordova CLI: 6.5.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.10.0
Xcode version: Xcode 8.2.1 Build version 8C1002

I get the error mentioned above.

Any hint to resolve this?

Thanks


#7

I also get the error as above.

What I did was I removed the folder node_modules/@angular/ from the project, then I replaced with new @angular folder that I got from another ionic 2 project.

Then I can ionic serve as usual.


#8

Small tip -ive come across this with my own projects- is removing the ^ from your npm packages,

When reinstalling your project or when someone runs your project the latest packages might not always work as expected.


#9

This is an unsustainable course of action that should not be encouraged or emulated.


#10

hi guess, i face also this error and i apply all this changes but there is no effect… :frowning: