Skip to content

Render Error: Cannot read property 'fn' of undefined in intl-pluralrules #772

@shekhar-nst

Description

@shekhar-nst

Version

5.26.2

Describe the bug

We encountered a render error in our React Native app that appears to be related to intl-pluralrules. The error occurs during the rendering of a component and is triggered while resolving plural rules for translations.
The app crashes with a render error related to intl-pluralrules.

Additional Context:

  • We already have the polyfills in src/polyfill/Intl.ts
  • The issue seems related to the pluralization logic in the translation system.
import { type BaseTranslation } from '../i18n-types'

const en_US = {
    daysLeft: '{days} {{day left|days left}}',
} satisfies BaseTranslation

export default en_US

Reproduction

Steps to Reproduce:

  • Run the app on a React Native environment.
  • Navigate to the screen containing the Text component which has plural rules.
    Observe the crash with the error message:
    "Cannot read property 'fn' of undefined"

Logs

Config

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions