web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
654 stars 170 forks source link

ReferenceError: Property 'Intl' doesn't exist #184

Closed adilusman51 closed 2 years ago

adilusman51 commented 2 years ago

Expo SDK 46 with custom dev-client and expo-localization Platform: iOS simulator

I am getting following error when trying to show Single Date Picker

ReferenceError: Property 'Intl' doesn't exist

This error is located at:
    in HeaderContentSingle (created by DatePickerModalContentHeader)
    in RCTView (created by View)
    in View (created by DatePickerModalContentHeader)
    in RCTView (created by View)
    in View (created by DatePickerModalContentHeader)
    in RCTView (created by View)
    in View (created by DatePickerModalContentHeader)
    in DatePickerModalContentHeader (created by DatePickerModalContent)
    in RCTSafeAreaView
    in SafeAreaView (created by DatePickerModalHeaderBackground)
    in RCTView (created by View)
    in View (created by AnimatedComponent)
    in AnimatedComponent
    in AnimatedComponentWrapper (created by DatePickerModalHeaderBackground)
    in DatePickerModalHeaderBackground (created by DatePickerModalContent)
    in DatePickerModalContent (created by DatePickerModal)
    in RCTView (created by View)
    in View (created by DatePickerModal)
    in RCTView (created by View)
    in View (created by DatePickerModal)
    in RCTView (created by View)
    in View (created by AppContainer)

Simulator Screen Shot - iPhone 13 - 2022-08-19 at 06 46 59

CosminGRG commented 2 years ago

Install: npm install intl Then import at the top of your file: import 'intl'; import 'intl/locale-data/jsonp/en';

RichardLindhout commented 2 years ago

Enable hermes on android don't use polyfills

RichardLindhout commented 2 years ago

Don't enable hermes on iOS yet Intl is not supported I think

adilusman51 commented 2 years ago

Yes, Intl is not supported on iOS with hermes. It's support is coming in React Native 0.70 according to the react native docs

RichardLindhout commented 2 years ago

Use polyfill of readme or disable hermes on iOS (would recommend the last for now)

adamchenwei commented 1 year ago

@RichardLindhout its not true though. For me, i am using React Native 0.68.2. have herme off. I still get the same error. so even its higher than 0.66, same error will still appear. can we reopen this ticket? or I also have to apply the same pollifill even I am higher than 0.66?