# Problem with routing in Ionic 4

**URL:** <https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787>\
**Category:** Ionic Framework\
**Created:** [July 3, 2019, 2:57pm UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787 "2019-07-03T14:57:00Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![EniolaTade](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EniolaTade](https://forum.ionicframework.com/u/EniolaTade)\
**Post date:** [July 3, 2019, 2:57pm UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/1 "2019-07-03T14:57:01Z")

</div>

![prosper](https://global.discourse-cdn.com/ionicframework/original/3X/7/7/77b91435c0ca18928714e21b4e1cf64f279a6346.png) ![prosper2](https://global.discourse-cdn.com/ionicframework/original/3X/6/7/67b6a332b99df52265c367e9088be7a4b5943f00.png)

How do i solve this problem?

---

<div class="post-metadata">

**Author:** ![Hammad6264](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hammad6264/32/128169_2.png) [@Hammad6264](https://forum.ionicframework.com/u/Hammad6264)\
**Post date:** [July 13, 2019, 2:17am UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/2 "2019-07-13T02:17:29Z")

</div>

The route ( tabs3 ) that you are trying to load is does not exist. make sure that you load right route.

---

<div class="post-metadata">

**Author:** ![EniolaTade](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EniolaTade](https://forum.ionicframework.com/u/EniolaTade)\
**Post date:** [July 15, 2019, 12:37pm UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/3 "2019-07-15T12:37:39Z")

</div>

how do i go about that please?

---

<div class="post-metadata">

**Author:** ![OmDIonic](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@OmDIonic](https://forum.ionicframework.com/u/OmDIonic)\
**Post date:** [July 15, 2019, 1:10pm UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/4 "2019-07-15T13:10:23Z")

</div>

Check whether you added it in HTML file.  
Sometimes we are not adding names in HMTL file and then trying to access them.

---

<div class="post-metadata">

**Author:** ![EniolaTade](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EniolaTade](https://forum.ionicframework.com/u/EniolaTade)\
**Post date:** [July 15, 2019, 5:14pm UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/5 "2019-07-15T17:14:36Z")

</div>

i do not understand. can i share my codes with you so you can view the error and correct them please?

---

<div class="post-metadata">

**Author:** ![OmDIonic](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@OmDIonic](https://forum.ionicframework.com/u/OmDIonic)\
**Post date:** [July 16, 2019, 7:11am UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/6 "2019-07-16T07:11:52Z")

</div>

I do it below way and its working for me

in .html

```auto
 <ion-content padding>
    <ion-tabs>
        <ion-tab-bar slot="bottom">
            <ion-tab-button tab="tab1">
                <ion-icon name="document"></ion-icon>
            </ion-tab-button>
            <ion-tab-button tab="tab2">
                <ion-icon name="document"></ion-icon>
            </ion-tab-button>
            <ion-tab-button tab="tab3">
                <ion-icon name="document"></ion-icon>
            </ion-tab-button>
        </ion-tab-bar>
    </ion-tabs>

```

in app-routing.module.ts

```auto
{ path: 'tabs/:id', component: ParentComponent,children:
  
    [
      {
        path: 'tab1',
        component: Component1,
      },
      {
        path: 'tab2',
        component: Component2,
      },
      {
        path: 'tab3',
        component: Component3,
       
      },
        {
        path: '',
        redirectTo: 'tabs/tab1',
        pathMatch: 'full'
      }
    ]
},

```

Try this way and let me know if it works.

Thanks

---

<div class="post-metadata">

**Author:** ![EniolaTade](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EniolaTade](https://forum.ionicframework.com/u/EniolaTade)\
**Post date:** [July 16, 2019, 8:46pm UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/7 "2019-07-16T20:46:15Z")

</div>

nothing seem to work. please i need help. its so urgent.

---

<div class="post-metadata">

**Author:** ![EniolaTade](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EniolaTade](https://forum.ionicframework.com/u/EniolaTade)\
**Post date:** [July 16, 2019, 8:57pm UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/8 "2019-07-16T20:57:33Z")

</div>

in my tabs.router.module.ts, i have the following codes

import { NgModule } from ‘@angular/core’;  
import { RouterModule, Routes } from ‘@angular/router’;  
import { TabsPage } from ‘./tabs.page’;

const routes: Routes = [  
{  
path: ‘tabs’,  
component: TabsPage,  
children: [  
{  
path: ‘home’,  
children: [  
{  
path: ‘’,  
loadChildren: ‘…/tab1/tab1.module#Tab1PageModule’  
}  
]  
},  
{  
path: ‘list’,  
children: [  
{  
path: ‘’,  
loadChildren: ‘…/tab2/tab2.module#Tab2PageModule’,  
}  
]  
},  
{  
path: ‘profile’,  
children: [  
{  
path: ‘’,  
loadChildren: ‘…/tab3/tab3.module#Tab3PageModule’  
}  
]  
},  
{  
path: ’ profile/:id’,  
children: [  
{  
path:’’,  
loadChildren: ‘…/tab3/tab3.module#Tab3PageModule’  
}  
]  
},  
{  
path: ‘’,  
redirectTo: ‘/tabs/home’,  
pathMatch: ‘full’  
}  
]  
},  
{  
path: ‘’,  
redirectTo: ‘/tabs/home’,  
pathMatch: ‘full’  
}  
];

@NgModule({  
imports: [  
RouterModule.forChild(routes)  
],  
exports: [RouterModule]  
})  
export class TabsPageRoutingModule {}

I dont know if this is wrong.

---

<div class="post-metadata">

**Author:** ![OmDIonic](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@OmDIonic](https://forum.ionicframework.com/u/OmDIonic)\
**Post date:** [July 17, 2019, 5:15am UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/9 "2019-07-17T05:15:33Z")

</div>

I think problem is about routing.  
One work around is create new fresh project with tabs using Ionic Cli  
and then check routing configuration.  
Also I doubt about this  
in your code

```auto
{
path: ’ profile/:id’,
children: [
{
path:’’,
loadChildren: ‘…/tab3/tab3.module#Tab3PageModule’
}

```

As much I understood that to move on profile detail page you are using profile?:id path.  
But I think profile detail should implement on different page and not in tabs.

so final solutions

1.Create fresh project with tabs using ionic cli and compare what you are doing wrong in your project  
2.Check routing in your project it may possible you declare something but that doesn’t exist

Thanks

---

<div class="post-metadata">

**Author:** ![EniolaTade](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EniolaTade](https://forum.ionicframework.com/u/EniolaTade)\
**Post date:** [July 17, 2019, 7:45am UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/10 "2019-07-17T07:45:30Z")

</div>

or do you think the version of ionic cli also matters? because i am using ionic version 5.2.2  
should i downgrade it back to version 4?

---

<div class="post-metadata">

**Author:** ![OmDIonic](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@OmDIonic](https://forum.ionicframework.com/u/OmDIonic)\
**Post date:** [July 17, 2019, 8:50am UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/11 "2019-07-17T08:50:09Z")

</div>

Ok try to downgrade and then try it.

---

<div class="post-metadata">

**Author:** ![aaronksaunders](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aaronksaunders/32/13729_2.png) [@aaronksaunders](https://forum.ionicframework.com/u/aaronksaunders)\
**Post date:** [July 18, 2019, 12:51am UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/12 "2019-07-18T00:51:39Z")

</div>

```auto
    {
        path: "profile",
        children: [
          {
            path: "",
            loadChildren: "./../profile/profile.module#ProfilePageModule"
          },
          {
            path: "profile-detail/:id",
            loadChildren: "./../profile/detail.module#ProfileDetailPageModule"
          }
        ]
      },

```

---

<div class="post-metadata">

**Author:** ![EniolaTade](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EniolaTade](https://forum.ionicframework.com/u/EniolaTade)\
**Post date:** [July 22, 2019, 9:20am UTC](https://forum.ionicframework.com/t/problem-with-routing-in-ionic-4/167787/13 "2019-07-22T09:20:47Z")

</div>

Hi Aaron! do you mind if i can share my codes with you? probably i will get a solution to this error.
