Skip to content

Intl support polyfill fails to load timezones on Android on 0.59.10 #25595

Closed
@bramski

Description

@bramski

Intl polyfill has stopped working on 0.59.10, after upgrading we found our app was producing Invalid DateTime for all timezone related strings on Android.

Diving more deeply, the following code crashes:
Intl.DateTimeFormat("en-US", { timeZone: 'America/New_York' }).format()
and produces
RangeError: timeZone is not supported

Package.json includes:

"intl": "^1.2.5",

and Root.js has:

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

React Native version:
info
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 834.63 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.12.0 - /usr/local/bin/node
Yarn: 1.16.0 - ~/.yarn/bin/yarn
npm: 6.10.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28
Build Tools: 22.0.1, 24.0.0, 27.0.3, 28.0.3, 29.0.0
System Images: android-24 | Android TV Intel x86 Atom, android-24 | Intel x86 Atom, android-24 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: ^0.59.10 => 0.59.10
npmGlobalPackages:
create-react-native-app: 0.0.6
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

Steps To Reproduce

  1. install intl polyfill
  2. add import 'intl' to your Root.js
  3. call Intl.DateTimeFormat("en-US", { timeZone: 'America/New_York' }).format()

Describe what you expected to happen:
App should not crash on lookup of the timezone string.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions