Ionic 3 missing Navigation URL

I am an Ionic noob. Just started my first project a month ago and it is almost in completing stage and then I realised that my app is always pointing to localhost:8100 when I run ionic serve.

Example - on landing on the home page, the URL should be localhost:8100/#/home on moving to the appointments page, it should change to localhost:8100/#/appointments but no matter what page I am in, it says localhost:8100

I am using lazyloading. I have included lazyloaded modules into app.module.ts. I have included the app page, IonicPageModule import and exports in my lazyloaded module. I have used @IonicPage({name: ‘name’, segment: ‘name’}) in the component.ts.

app.module.ts -

import { AppointmentsPageModule } from './../pages/appointments/appointments.module';
import { AppointmentsPage } from './../pages/appointments/appointments';
...

@NgModule({
  declarations: [
    MyApp,
    AppointmentsPage,
    ...
  ],
  imports: [
    AppointmentsPageModule
    ...
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    AppointmentsPage,
    ...
  ],
  providers: [
    ...
  ]
})
export class AppModule {}

appointments.module.ts -

import { AppointmentsPage } from './appointments';
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';

@NgModule({
  declarations: [

  ],
  imports: [
    IonicPageModule.forChild(AppointmentsPage)
  ],
  exports: [
    AppointmentsPage
  ]
})
export class AppointmentsPageModule {}

and included this in appointments.ts -

@IonicPage({
  name: 'appointments',
  segment: 'appointments'
})

And I am using

this.navCtrl.push('appointments');

I have been searching for a solution for this in all of google and Ionic Worldwide Slack but have not been able to find a solution. Please assist.

Ionic CLI version - 4.0.3 Cordova version - 8.0.0

I have the same problem with an app upgraded from Ionic 2. I also have a index.html there that won’t go away. Did you ever fix it?

I’ve been using Deeplinker and its settings as an alternative. It works but I’m not sure it will work with Deeplinks (for external URLs).

Hey, Sorry I was away and yes, I did solve it. Check this for the solution.

1 Like