I build my project on IONIC (version 6.10.0)
- ionic cordova build browser --prod
- ionic cordova run browser
My project starts,
but when I refresh the page, then I have the following error:
How can I fix this? The routes are however well configured:
My routing code :
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
const routes: Routes = [
// english
{
path: '',
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
},
{
path: 'home',
pathMatch: 'full',
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
},
{
path: 'support',
loadChildren: () => import('./support/support.module').then( m => m.SupportPageModule)
},
{
path: 'user-profile',
loadChildren: () => import('./user-profile/user-profile.module').then( m => m.UserProfilePageModule)
},
{
path: 'choose-destination',
loadChildren: () => import('./choose-destination/choose-destination.module').then( m => m.ChooseDestinationPageModule)
},
{
path: 'become-guide',
loadChildren: () => import('./become-guide/become-guide.module').then( m => m.BecomeGuidePageModule)
},
{
path: 'selection-guide',
loadChildren: () => import('./selection-guide/selection-guide.module').then( m => m.SelectionGuidePageModule)
},
{
path: 'guide-form',
loadChildren: () => import('./guide-form/guide-form.module').then( m => m.GuideFormPageModule)
},
{
path: 'form-sent',
loadChildren: () => import('./form-sent/form-sent.module').then( m => m.FormSentPageModule)
},
{
path: 'ticket-sent',
loadChildren: () => import('./ticket-sent/ticket-sent.module').then( m => m.TicketSentPageModule)
},
{
path: 'profile-guide',
loadChildren: () => import('./profile-guide/profile-guide.module').then( m => m.ProfileGuidePageModule)
},
{
path: 'edit-profile',
loadChildren: () => import('./edit-profile/edit-profile.module').then( m => m.EditProfilePageModule)
},
{
path: 'edit-guide-profile',
loadChildren: () => import('./edit-guide-profile/edit-guide-profile.module').then( m => m.EditGuideProfilePageModule)
},
{
path: 'sign-in',
loadChildren: () => import('./sign-in/sign-in.module').then( m => m.SignInPageModule)
},
{
path: 'sign-up',
loadChildren: () => import('./sign-up/sign-up.module').then( m => m.SignUpPageModule)
},
{
path: 'payment',
loadChildren: () => import('./payment/payment.module').then( m => m.PaymentPageModule)
},
// French
{
path: 'accueil',
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
},
// Chinois
{
path: '家',
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
},
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule {}
Here is my routing code, maybe I forgot to add something!
Thanks for your help !