Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Cannot read property 'prototype' of undefined error #97

Open
StCyr opened this issue May 15, 2024 · 0 comments
Open

Bug: Cannot read property 'prototype' of undefined error #97

StCyr opened this issue May 15, 2024 · 0 comments

Comments

@StCyr
Copy link

StCyr commented May 15, 2024

Description

In a react-native expo iOS app, after upgrading i18n-js to version 4+ (tested with 4.4.3, 4.4.2, and 4.0.0), I get a "Cannot read property 'prototype' of undefined" error when I try to instantiate a new I18n class.

This error has been reported here but I could only fix it by downgrading to version 3.8.0

How to reproduce

Here's the code that triggers this issue:

import * as Localization from 'expo-localization';
import I18n from 'i18n-js';
import { en, fr, ru, ua, ca, de, it, sv, pl } from './languages';

const i18n = new I18n({ en, fr, ru, ua, ca, de, it, sv, pl });

i18n.fallbacks = true;
i18n.defaultLocale = 'en';
i18n.locale = Localization.locale;

export {i18n};

What do you expect

const i18n instantiated properly

What happened instead

"Cannot read property 'prototype' of undefined error"

Full backtrace

Here's a screenshot of the stacktrace:

24-05-15 11-05-01 7079

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant