Skip to content

terminating with uncaught exception of type folly::json::parse_error: folly::toJson: JSON object value was a NaN or INF #163

Open
@gudberg

Description

@gudberg

Bug

I updated to v3 and I am using BottomSheetSectionList. I experience crashes when scrolling to top position of the bottomSheet, and the error is

libc++abi.dylib: terminating with uncaught exception of type folly::json::parse_error: folly::toJson: JSON object value was a NaN or INF
terminating with uncaught exception of type folly::json::parse_error: folly::toJson: JSON object value was a NaN or INF

Environment info

Library Version
@gorhom/bottom-sheet 3.0.2-alpha.2
react-native 0.63.3
react-native-reanimated 2.0.0-rc.1
react-native-gesture-handler 1.9.0

Steps To Reproduce

       <BottomSheet
               // ref={sheetRef}
               backgroundComponent={() => (
                  <View style={{ backgroundColor: COLORS.THEME.MODAL_DARK }} />
               )}
               handleComponent={() => (
                  <View style={{ backgroundColor: COLORS.THEME.TRANSPARENT, alignItems: 'center' }}>
                     <View
                        style={{
                           width: 40,
                           borderTopWidth: 5,
                           borderTopColor: '#979797',
                           borderRadius: 6,
                           marginBottom: 5,
                           backgroundColor: COLORS.THEME.MODAL_DARK,
                        }}
                     />
                  </View>
               )}
               snapPoints={snapPoints}>
                  <BottomSheetSectionList
                    style={styles.scrollBottomSheet}
                    sections={
                       moments.length === 0 && closedMoments.length === 0 ? [] : (sections as any)
                    }
                    stickySectionHeadersEnabled
                    ref={ref}
                    keyExtractor={(item, index) => `${index} ${item}`}
                    renderSectionHeader={renderSectionHeader}
                    onEndReached={() => fetchNextClosedMoments()}
                    onEndReachedThreshold={1}
                    ListEmptyComponent={() => <EmptyState />}
                    renderItem={renderItem}
                    showsVerticalScrollIndicator={false}
                    ListHeaderComponent={cardOverlay}
                    ListFooterComponent={loadingFooter}
               />       
        </BottomSheet>


  • Explain the steps we need to take to reproduce the issue:
    -->
  1. Scroll and go to top position of the bottom sheet
  2. Drag the bottom sheet several times, and try also to do it slowly, from the top position, scroll down and then up, and change snapPoint to the lowest one(default position of the bottom sheet).
  3. The application crashes with the exception described above. Does not happen always.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv3Written in Reanimated v2

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions