I followed the upgrade steps in the changelog to convert my existing project to rc0.
When I run ionic-app-scripts build or ngc (or anything that directly triggers that command), I get the following error:
[08:50:01] ngc error: Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppRootToken in C:/Project/node_modules/ionic-angular/components/app/app-root.d.ts, resolving symbol IonicModule in C:/Project/node_modules/ionic-angular/module.d.ts, resolving symbol AppModule in C:/Project/.tmp/app/app.module.ts, resolving symbol AppModule in C:/Project/.tmp/app/app.module.ts
at simplifyInContext (C:\Project\node_modules\@angular\compiler-cli\src\static_reflector.js:469:23)
at StaticReflector.simplify (C:\Project\node_modules\@angular\compiler-cli\src\static_reflector.js:472:22)
at StaticReflector.annotations (C:\Project\node_modules\@angular\compiler-cli\src\static_reflector.js:61:36)
at _loop_1 (C:\Project\node_modules\@angular\compiler-cli\src\codegen.js:53:54)
at CodeGenerator.readFileMetadata (C:\Project\node_modules\@angular\compiler-cli\src\codegen.js:66:13)
at C:\Project\node_modules\@angular\compiler-cli\src\codegen.js:100:74
at Array.map (native)
at CodeGenerator.codegen (C:\Project\node_modules\@angular\compiler-cli\src\codegen.js:100:35)
at codegen (C:\Project\node_modules\@angular\compiler-cli\src\main.js:7:81)
at Object.main (C:\Project\node_modules\@angular\tsc-wrapped\src\main.js:30:16)
[08:50:01] ngc error: Compilation failed
I am able to successfully build the tabs starter, so clearly this is an issue with my app. However, I’ve commented out most of my app.module.ts, leaving only:
//import {ContestPage} from '../pages/contest/contest';
//import {TradeView} from '../pages/trade/trade';
//import {GameView} from '../pages/game/game';
//import {SecurityService} from '../services/security.service';
//import {UserDataService} from '../services/userData.service';
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';
//import { HomeView } from '../pages/home/home';
@NgModule({
/*declarations: [
MyApp,
HomeView,
GameView,
TradeView,
ContestPage
],*/
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
// MyApp,
// HomeView
]/*,
providers: [SecurityService, UserDataService]*/
})
export class AppModule {
}
The error is coming from the use of IonicModule.ForRoot it seems. As a result, I’m not sure where to go from here. Can anyone help?
Tried reinstalling all npm modules as well but with no result. Still getting:
ngc error: Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 167:19 in the original .ts file), resolving symbol AppModule in .tmp/app/app.module.ts
You’re getting this error message because one or more of the NG2 plugins you’re using is missing the metadata file required for the AOT compilation. I had the same problem with the ng2-translate plugin, which they’ve fixed today by adding the metadata file.
Thanks for the help. Where does this code go?
BTW, I have used Cordova before before. This is my first experience with Ionic or Ionic2. I can run on android but not ios.
I am getting this issue today with a brand new ‘ionic start ionictwoapple --v2’ (add a symbolic link) ‘ionic run ios’
I had to add a symbolic link to node_modules/tslint-eslint-rules to fix a different build error I encountered.
Thanks for the clarification. I had success with @bytenik 's suggestion to npm uninstall.
I did npm uninstall -g for ionic, cordova and angular/angular-cli packages, and then re-installed following:
That worked for me much cleaner than in my previous environment.