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

No locale data has been provided for this object yet. #135

Open
astonishqft opened this issue Jul 20, 2020 · 12 comments
Open

No locale data has been provided for this object yet. #135

astonishqft opened this issue Jul 20, 2020 · 12 comments

Comments

@astonishqft
Copy link

升级完了你们最新的版本[email protected]之后,编译完运行会报错,之前的版本是没问题的

E88BE704-C4CF-4787-9080-6FED968C591E

@cwtuan
Copy link
Collaborator

cwtuan commented Jul 24, 2020

hi, please provide your code and locale files

@pavelglebov
Copy link

pavelglebov commented Aug 7, 2020

Same issue after update to 2.3.2, code is plain just from the example, locales - en, ru.
2.2.5 works fine

@cwtuan
Copy link
Collaborator

cwtuan commented Aug 9, 2020

@pavelglebov
It seems fine when I running the browser-example.
Could you provide more info?
Thanks

image
image

@olebrun
Copy link

olebrun commented Sep 14, 2020

Have the same issue with 2.4.1 and react-native on android and only in debug mode.
Work on non-debug mode et work on ios debug or non-debug mode ... weird ?

Works ok on 2.2.5

@cwtuan
Copy link
Collaborator

cwtuan commented Sep 14, 2020

@olebrun could you provide your code example and locale files

@olebrun
Copy link

olebrun commented Sep 14, 2020

I will try to provide you a working test app these next day.

@astonishqft
Copy link
Author

hi, please provide your code and locale files

我的场景是这样的:

我在主系统里面使用了 react-intl-universal,然后将子系统通过微前端的方式集成到主系统的时候就会报这个错,子系统也使用了react-intl-universal,所以我分析是不是父子系统集成的时候互相影响了。另外如果使用 2.2.5 这个版本就不会报错

@cwtuan
Copy link
Collaborator

cwtuan commented Sep 18, 2020

@astonishqft
We also have micro-frontend architecture, but we don't encounter this issue.
Please provide your code sample.

@oleksandr-dziuban
Copy link

I can confirm that on react-native Android Hermes Engine the latest version is broken. If I downgrade to 2.2.5 it's OK, also if debugger enabled and Google V8 engine is active - it's OK too. Looks like we need intl polyfill now for Android native envs

@oleksandr-dziuban
Copy link

oleksandr-dziuban commented Oct 28, 2020

Confirmed:
Just install yarn add intl:

And add

import 'intl';
import 'intl/locale-data/jsonp/en';

in the root index.js of your app and everything works on Android.

Polyfill is needed now in latest version of this lib.

@cwtuan
Copy link
Collaborator

cwtuan commented Oct 28, 2020

For non-browser application, you should add intl and the locale-data manually.

https://github.com/alibaba/react-intl-universal/blob/master/examples/node-js-example/src/App.js#L11-L16

@oleksandr-dziuban
Copy link

oleksandr-dziuban commented Apr 19, 2021

Add

yarn add intl
yarn add intl-pluralrules

And add these polyfills to index.js root file:

import 'intl';
import 'intl/locale-data/jsonp/en';
import 'intl-pluralrules'

to support intl and plurals on react native.

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

5 participants