For using React-intl on android we must add a polyfill, since Intl isn't supported yet in android. When importing the Intl polyfill in RN41.2 the react-intl library works fine. When using the same import in RN 42 the following error is thrown:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 548): SyntaxError: TransformError: /Users/headless/tmp/TestIntlCrash/node_modules/intl/lib/core.js: Cannot read property 'tokens' of undefined
This is the same error as described in https://github.com/facebook/react-native/issues/12071, but since the issue was closed for an unclear issue name, I created this issue.
Try using react-intl in an android emulator, then try including the intl polyfill with
import 'intl';
When testing in RN41.2 it will work, in RN 42 it won't
Something seems to be wrong when the packager processes the core.js file
cc @ericvicenti since you closed the previous bug report
It's also happening here... same setup.
I have the same problem. Do anyone find workaround?
I have the same problem too, so I back to the 0.41.2
@doochik adding this on package.json fixed for me
"postinstall": "rm -f node_modules/intl/.babelrc"
more here: https://github.com/andyearnshaw/Intl.js/pull/264#issuecomment-279947557
alexandrebini's solution doesn't work for me on RN v0.44.2 on Linux. It's weird.
This issue has been opened on March 3rd.
I wonder that is there any workaround to overcome this issue.
I cannot run the project on emulator.
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
Most helpful comment
@doochik adding this on
package.jsonfixed for memore here: https://github.com/andyearnshaw/Intl.js/pull/264#issuecomment-279947557