I have been working on a project using Ionic 2, with the initial page set to AuthPage. I recently added a new page called SplashPage through the console. However, when I tried setting the rootPage to SplashPage, I encountered an error stating
Uncaught Error: Cannot find module "./pages/splash/splash"
(app.bundle.js:3188). Any ideas on what might be causing this issue?
Here is my code in app.ts:
import {App, IonicApp, Platform} from 'ionic-angular';
import {ListPage} from './pages/list/list';
import {WishListPage} from './pages/wishlist/wishlist';
import {AuthPage} from './pages/auth/auth';
import {SplashPage} from './pages/splash/splash';
@App({
templateUrl: 'build/app.html',
config: {}, // http://ionicframework.com/docs/v2/api/config/Config/
providers: [UserService]
})
class MyApp {
rootPage: any = SplashPage;
pages: Array<{title: string, component: any, user: string}>;
user: any;
constructor(private app: IonicApp, private platform: Platform,
private userService: UserService) {
this.initializeApp();
this.user = userService;
// Pages configuration
this.pages = [
{ title: 'Wishlist', component: WishListPage, user: "shopper"},
{ title: 'Current Orders', component: ListPage, user: "shopper" },
{ title: 'Orders', component: ListPage, user: "boxer" },
{ title: 'Profile', component: ProfilePage, user:"both" }
];
}
This is the code for splash.ts:
import {OnInit} from 'angular2/core';
import {NgIf} from 'angular2/common';
import {Page, NavController} from 'ionic-angular';
// @PAGES
import {AuthPage} from '../auth/auth';
@Page({
templateUrl: 'build/pages/splash/splash.html',
directives: [NgIf],
providers: []
})
export class SplashPage {
constructor() { console.log("@AuthPage: __init__"); }
}