Skip to content

fix: crash on Create Account (common.91)

POORNA CHANDRA SAI TEJA KUMPATLA requested to merge fix-create-account into develop

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.91 from 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.json
  • src/locales/te/translations.json
  • src/locales/hi/translations.json

Technical Details

Root Cause:

  • common.91 was 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

Before create account

After create account


How to Set Up and Validate Locally

  1. Checkout this branch

  2. Install dependencies:

    bun install
  3. Run the app:

    bun dev
  4. Open:

    http://localhost:5173
  5. Navigate to Create Account

  6. 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

Merge request reports

Loading