You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-12-26] [$250] The 'navigation' object hasn't been initialized yet" console error #76536
Version Number: 9.2.67-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@QichenZhu Slack conversation (hyperlinked to channel name): #Expensify Bugs
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
During sign-in, a console error appears: "The 'navigation' object hasn't been initialized yet". This error occurs when navigation functions try to access the navigation state before the NavigationContainer is ready.
What is the root cause of that problem?
Several Navigation functions in App/src/libs/Navigation/Navigation.ts access navigation state without checking if navigation is ready first. These functions call navigationRef.getState() or navigationRef.getRootState() during sign-in before the NavigationContainer has finished initializing.
The affected functions are:
getTopmostReportId - calls navigationRef.getState() without checking readiness
getTopmostReportActionId - calls navigationRef.getState() without checking readiness
getActiveRoute - calls navigationRef.getRootState() without checking readiness
getReportRouteByID - calls navigationRef.getRootState() without checking readiness
isOnboardingFlow - calls navigationRef.getRootState() without checking readiness
isValidateLoginFlow - calls navigationRef.getRootState() without checking readiness
resetToHome - calls navigationRef.getRootState() without checking readiness
getVisibleWideRHPKeys in App/src/components/WideRHPContextProvider/getVisibleRHPRouteKeys.ts - calls navigationRef.getRootState() without checking readiness
When these functions are called during the sign-in process or during component initialization (which happens early in the app lifecycle), the navigation ref may not be ready yet, causing React Navigation to throw the error.
What changes do you think we should make in order to solve the problem?
Add navigation readiness checks to all affected functions in App/src/libs/Navigation/Navigation.ts:
1. getTopmostReportId and getTopmostReportActionId:
// Before:functiongetActiveRoute(): string{constcurrentRoute=navigationRef.current&&navigationRef.current.getCurrentRoute();if(!currentRoute?.name){return'';}constrouteFromState=getPathFromState(navigationRef.getRootState(),linkingConfig.config);if(routeFromState){returnrouteFromState;}return'';}// After:functiongetActiveRoute(): string{// Safe handling when navigation is not yet initializedif(!navigationRef.isReady()){return'';}constcurrentRoute=navigationRef.current&&navigationRef.current.getCurrentRoute();if(!currentRoute?.name){return'';}constrouteFromState=getPathFromState(navigationRef.getRootState(),linkingConfig.config);if(routeFromState){returnrouteFromState;}return'';}
3. getReportRouteByID:
// Before:functiongetReportRouteByID(reportID?: string,routes: NavigationRoute[]=navigationRef.getRootState().routes): NavigationRoute|null{if(!reportID||!routes?.length){returnnull;}// ... rest of function}// After:functiongetReportRouteByID(reportID?: string,routes?: NavigationRoute[]): NavigationRoute|null{// Safe handling when navigation is not yet initializedif(!navigationRef.isReady()){returnnull;}constroutesToSearch=routes??navigationRef.getRootState().routes;if(!reportID||!routesToSearch?.length){returnnull;}// ... rest of function}
4. isOnboardingFlow:
// Before:functionisOnboardingFlow(){conststate=navigationRef.getRootState();constcurrentFocusedRoute=findFocusedRoute(state);returnisOnboardingFlowName(currentFocusedRoute?.name);}// After:functionisOnboardingFlow(){// Safe handling when navigation is not yet initializedif(!navigationRef.isReady()){returnfalse;}conststate=navigationRef.getRootState();constcurrentFocusedRoute=findFocusedRoute(state);returnisOnboardingFlowName(currentFocusedRoute?.name);}
5. isValidateLoginFlow:
// Before:functionisValidateLoginFlow(){conststate=navigationRef.getRootState();constcurrentFocusedRoute=findFocusedRoute(state);returncurrentFocusedRoute?.name===SCREENS.VALIDATE_LOGIN;}// After:functionisValidateLoginFlow(){// Safe handling when navigation is not yet initializedif(!navigationRef.isReady()){returnfalse;}conststate=navigationRef.getRootState();constcurrentFocusedRoute=findFocusedRoute(state);returncurrentFocusedRoute?.name===SCREENS.VALIDATE_LOGIN;}
6. resetToHome:
// Before:functionresetToHome(){constisNarrowLayout=getIsNarrowLayout();constrootState=navigationRef.getRootState();// ... rest of function}// After:functionresetToHome(){// Safe handling when navigation is not yet initializedif(!navigationRef.isReady()){return;}constisNarrowLayout=getIsNarrowLayout();constrootState=navigationRef.getRootState();// ... rest of function}
7. getVisibleWideRHPKeys:
// Before:functiongetVisibleWideRHPKeys(allWideRHPKeys: string[]){constrootState=navigationRef.getRootState();if(!rootState){return[];}// ... rest of function}// After:functiongetVisibleWideRHPKeys(allWideRHPKeys: string[]){// Safe handling when navigation is not yet initializedif(!navigationRef.isReady()){return[];}constrootState=navigationRef.getRootState();if(!rootState){return[];}// ... rest of function}
This pattern already exists in the codebase - getReportRHPActiveRoute function demonstrates the correct approach with a readiness check and safe return value.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]The 'navigation' object hasn't been initialized yet" console error[/-][+][$250] The 'navigation' object hasn't been initialized yet" console error[/+]on Dec 5, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.84-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@hungvu193@dylanexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Test:
Login with any account.
Verify that there's no error console The 'navigation' object hasn't been initialized yet"
Activity
melvin-bot commentedon Dec 2, 2025
Triggered auto assignment to @dylanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.thelullabyy commentedon Dec 2, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The 'navigation' object hasn't been initialized yet" console error displayed
What is the root cause of that problem?
We don't check if
navigationRefis ready or not before calling itApp/src/components/WideRHPContextProvider/getVisibleRHPRouteKeys.ts
Line 10 in 98233f1
So it throws err when trying to access

What changes do you think we should make in order to solve the problem?
We should safe handling when navigation is not yet initialized first here
Could do similar these places (and other places use navigation) as well
App/src/libs/Navigation/helpers/isRoutePreloaded.ts
Line 5 in fa5e06d
App/src/libs/Navigation/Navigation.ts
Line 125 in 98233f1
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
abbasifaizan70 commentedon Dec 2, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
During sign-in, a console error appears: "The 'navigation' object hasn't been initialized yet". This error occurs when navigation functions try to access the navigation state before the NavigationContainer is ready.
What is the root cause of that problem?
Several Navigation functions in
App/src/libs/Navigation/Navigation.tsaccess navigation state without checking if navigation is ready first. These functions callnavigationRef.getState()ornavigationRef.getRootState()during sign-in before the NavigationContainer has finished initializing.The affected functions are:
getTopmostReportId- callsnavigationRef.getState()without checking readinessgetTopmostReportActionId- callsnavigationRef.getState()without checking readinessgetActiveRoute- callsnavigationRef.getRootState()without checking readinessgetReportRouteByID- callsnavigationRef.getRootState()without checking readinessisOnboardingFlow- callsnavigationRef.getRootState()without checking readinessisValidateLoginFlow- callsnavigationRef.getRootState()without checking readinessresetToHome- callsnavigationRef.getRootState()without checking readinessgetVisibleWideRHPKeysinApp/src/components/WideRHPContextProvider/getVisibleRHPRouteKeys.ts- callsnavigationRef.getRootState()without checking readinessWhen these functions are called during the sign-in process or during component initialization (which happens early in the app lifecycle), the navigation ref may not be ready yet, causing React Navigation to throw the error.
What changes do you think we should make in order to solve the problem?
Add navigation readiness checks to all affected functions in
App/src/libs/Navigation/Navigation.ts:1. getTopmostReportId and getTopmostReportActionId:
2. getActiveRoute:
3. getReportRouteByID:
4. isOnboardingFlow:
5. isValidateLoginFlow:
6. resetToHome:
7. getVisibleWideRHPKeys:
This pattern already exists in the codebase -
getReportRHPActiveRoutefunction demonstrates the correct approach with a readiness check and safe return value.What alternative solutions did you explore? (Optional)
None
Demo
This error is no longer visible.

PiyushChandra17 commentedon Dec 3, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
There's a console error "Navigation object hasn't been initialized yet"
What is the root cause of that problem?
The console error comes from React Navigation, when we call navigationRef.getRootState() before React Navigation has mounted here
What changes do you think we should make in order to solve the problem?
We need to add a check
navigationRef.isReady()before NavigatingWhat alternative solutions did you explore? (Optional)
Or we can replace the direct call with a safe check so the function returns early when Navigation is not ready
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]The 'navigation' object hasn't been initialized yet" console error[/-][+][$250] The 'navigation' object hasn't been initialized yet" console error[/+]melvin-bot commentedon Dec 5, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021997004322612288913
melvin-bot commentedon Dec 5, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (
External)22 remaining items
melvin-bot commentedon Dec 19, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.84-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-12-26. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Dec 19, 2025
@hungvu193 @dylanexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
mvtglobally commentedon Dec 20, 2025
Issue not reproducible during KI retests. (First week)
hungvu193 commentedon Dec 29, 2025
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/76163/changes#r2650135674
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Test:
The 'navigation' object hasn't been initialized yet"Do we agree 👍 or 👎
melvin-bot commentedon Dec 31, 2025
@dylanexpensify Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Jan 2, 2026
@dylanexpensify Still overdue 6 days?! Let's take care of this!
dylanexpensify commentedon Jan 5, 2026
Payment summary:
Contributor: @thelullabyy $250 via Upwork
Contributor+: @hungvu193 $250 via NewDot
Please apply/request!
twisterdotcom commentedon Jan 7, 2026
@hungvu193 has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-2001-a9d0-9e36-c8e78537d684QichenZhu commentedon Oct 21, 2026
Can we reopen this issue? It happens every time I open the Android and iOS apps.
Simulator.Screen.Recording.-.iPhone.17.-.2026-10-21.at.14.42.34.mov