fix: crash on Create Account (common.91)
Overview
This MR fixes a React crash occurring on the Create Account page due to an invalid i18n translation structure. The issue was caused by rendering an object instead of a string from the translation key common.91.
What does this MR do and why?
- Fixes the error: "Objects are not valid as a React child"
- Ensures the phone prefix (
+91) renders correctly - Prevents blank screen when clicking Create Account
Motivation: Users were unable to create accounts due to a runtime crash caused by incorrect translation data.
Approach:
- Converted
common.91from an object → string in all translation files - Ensured compatibility with existing usage
{t('common.91')}
Changes Made
-
Updated translation structure:
-
common.91→"+91"
-
Files Modified
src/locales/en/translations.jsonsrc/locales/te/translations.jsonsrc/locales/hi/translations.json
Technical Details
Root Cause:
-
common.91was defined as an object - React attempted to render it directly → crash
Fix:
- Replaced object with string value
- Ensured
t('common.91')returns a string
Type of Change
-
🐛 Bug fix (non-breaking change that fixes an issue) -
✨ New feature -
💥 Breaking change -
📝 Documentation update -
🎨 UI/UX improvement -
♻ ️ Refactor -
⚡ Performance improvement -
🧪 Test update -
🔧 Configuration change -
🚨 Security fix
Related Issues / References
closes #291 (closed)
Screenshots or Screen Recordings
How to Set Up and Validate Locally
-
Checkout this branch
-
Install dependencies:
bun install -
Run the app:
bun dev -
Open:
http://localhost:5173 -
Navigate to Create Account
-
Verify:
- No crash occurs
- "+91" is displayed in phone input
Testing Done
-
Manual testing completed -
Unit tests added/updated
Test Cases Covered
| Scenario | Expected Result | Status |
|---|---|---|
| Create Account page load | No crash | |
| Phone prefix render | "+91" visible | |
| Console errors | No errors |
Code Quality Checklist
Code Standards
-
Code follows project conventions -
No console logs left -
No unused code -
No hardcoded strings -
ESLint passes
Documentation
-
README.md updated (not required)
Known Limitations / Technical Debt
- Current fix assumes only string usage
- Future multi-country support may require restructuring to object format
Additional Notes
Root cause was improper i18n structure. This fix ensures safe rendering and avoids runtime crashes.
Edited by POORNA CHANDRA SAI TEJA KUMPATLA

