getting below exception when navigating from one page to another
angular2-polyfills.js:324 Uncaught EXCEPTION: Error during evaluation of "click"
ORIGINAL EXCEPTION: TypeError: Cannot read property 'annotations' of undefined
ORIGINAL STACKTRACE:
TypeError: Cannot read property 'annotations' of undefined
at ReflectionCapabilities.annotations (http://192.168.0.101:8100/build/js/app.bundle.js:26281:40)
at Reflector.annotations (http://192.168.0.101:8100/build/js/app.bundle.js:26423:48)
at DirectiveResolver.resolve (http://192.168.0.101:8100/build/js/app.bundle.js:21217:44)
at RuntimeMetadataResolver.getDirectiveMetadata (http://192.168.0.101:8100/build/js/app.bundle.js:8691:51)
at TemplateCompiler.compileHostComponentRuntime (http://192.168.0.101:8100/build/js/app.bundle.js:10279:54)
at RuntimeCompiler_.compileInHost (http://192.168.0.101:8100/build/js/app.bundle.js:8617:39)
at NavController.loadPage (http://192.168.0.101:8100/build/js/app.bundle.js:44176:42)
at NavController._render (http://192.168.0.101:8100/build/js/app.bundle.js:43837:18)
at NavController._transition (http://192.168.0.101:8100/build/js/app.bundle.js:43802:14)
at NavController._insertViews (http://192.168.0.101:8100/build/js/app.bundle.js:43462:26)
ERROR CONTEXT:
[object Object]
system information:
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.5
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.4.1
Xcode version: Xcode 7.3 Build version 7D175
I have created a slider on the first page to display information about the app. Followed by buttons to Login or Signup. Button click action results into the exception.
Sample code
app.js
import {App, Platform} from 'ionic-angular';
import {StatusBar} from 'ionic-native';
import {MomaPage} from './pages/moma/moma';
import {UserAuthPage} from './pages/login/login';
import {SignupPage} from './pages/-signup/-signup';
import {HomePage} from './pages/home/home';
@App({
template: '<ion-nav swipeBackEnabled="true" id="app-nav" [root]="rootPage"></ion-nav>',
config: {}
})
export class MyApp {
static get parameters() {
return [[Platform]];
}
constructor(platform) {
this.rootPage = MomaPage;
this.platform = platform;
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
StatusBar.styleDefault();
});
}
}
@psbabu007 Unless I’m not missing something, the code looks OK. Maybe there’s a problems in any of the other pages. Could you post the source code of one or both of them as well?
And it worked. This is because I called the class TabsPage and didnt realize that the import has to match exactly, thought of it more as a variable name. But now I know
@psbabu007 Are you still facing the problem or you already managed to solve it? Also check your imports and exports as well. And notice that you can’t import a class that you haven’t **export**ed before that.