I’m developing an app called SubTrack using Angular and Capacitor, with Firebase used solely for data storage. Everything works perfectly in local development using ng serve, I am facing an issue where the content of my Angular app is not displayed after deploying it to a mobile device using Capacitor. Here is the context and what I’ve tried so far:"
Technologies used:
Problem description:
Steps already tried: Verified that the API calls to Firebase return the expected data. Checked the Capacitor configuration (capacitor.config.ts) and the files in the www folder. Confirmed that the guards for authentication work as expected in local development.
Deployment details:
Questions:
Code sample:
Here is a simplified example of my routing configuration:
export const routes: Routes = [
{
path: '',
redirectTo: 'home',
pathMatch: 'full',
},
{
path: 'home',
component: SubListComponent,
canActivate: [authGuard],
},
{
path: 'login',
component: LoginComponent,
},
{
path: 'home/sub-details/:id',
component: SubDetailsComponent,
canActivate: [authGuard],
},
{
path: 'search',
component: SearchComponent,
canActivate: [authGuard],
},
{
path: 'add',
component: AddSubComponent,
canActivate: [authGuard],
},
{
path: 'notifications',
component: NotificationsComponent,
canActivate: [authGuard],
},
{
path: 'account',
component: AccountComponent,
canActivate: [authGuard],
},
{
path: 'signin',
component: SigninComponent,
},
{
path: 'update/:id',
component: UpdateSubComponent,
canActivate: [authGuard],
},
{
path: '404',
component: Page404Component,
},
{
path: '**',
redirectTo: '404',
pathMatch: 'full',
},
]
Let me know if additional information is needed. Thank you for your help!
"Screenshot of the subscriptions page on mobile after deployment. The bottom menu bar and the page title are visible, but the list of subscriptions and the chart are missing. The main content of the page is completely empty."
Subscriptions Page Mobile Screenshot
"Screenshot of the subscriptions page in local development using ng serve. All content displays correctly: the list of subscriptions and the chart are visible as expected."
Subscriptions Page Web Screenshot
"Screenshot of the Account page on mobile after deployment. The bottom menu bar and the page title are visible, but the user's first and last name do not appear, even though the app considers the user logged in."
Account Page Mobile Screenshot
"Screenshot of the Account page in local development using ng serve. The first and last name of the logged-in user are displayed correctly, as expected."
Account Page WebScreenshot