question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
giasetcommented, May 19, 2021

Same issue here on @gorhom/bottom-sheet 3.6.4 and reanimated 2.1.0

I have one bottom sheet that gets this crash pretty consistently when I wiggle it around

1reaction
gorhomcommented, Jan 9, 2021

found it, it seems that it occurs out of this library implementation, however i’ll spend time to investigate it and have better answer and hopefully fix it 👍

[Sat Jan 09 2021 15:57:29.150]  WARN     The value `scrollView.contentOffset.y` equals NaN or INF and will be replaced by `0`.

thanks @gudberg again for spending the time to reproduce it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found