Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) TypeError: Cannot assign to read only property 'aroundRadius' of object '#<Object>' #6136

Closed
1 task done
TristanMaurier98 opened this issue Apr 15, 2024 · 5 comments 路 Fixed by #6193
Labels
triage Issues to be categorized by the team

Comments

@TristanMaurier98
Copy link

馃悰 Current behavior

Since the version 7.7.1 of react-instantsearch-core when using Configure a crash and a type error appear when aroundRadius is set at "all"

Stack trace:

merge.js:48 Uncaught (in promise) TypeError: Cannot assign to read only property 'aroundRadius' of object '#'
at _merge (merge.js:48:1)
at merge (merge.js:78:1)
at push../node_modules/algoliasearch-helper/src/SearchParameters/index.js.SearchParameters._parseNumbers (index.js:303:1)
at new SearchParameters (index.js:98:1)
at Object.getRenderState (connectConfigure.js:72:1)
at index.js:414:1
at Array.forEach ()
at Object.render (index.js:412:1)
at index.js:431:1
at Array.forEach ()
at Object.render (index.js:422:1)
at InstantSearch.js:105:1
at defer.js:18:1

The above error occurred in the component:

at Configure (http://localhost:3000/static/js/0.chunk.js:259274:83)
at Index (http://localhost:3000/static/js/0.chunk.js:259434:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at http://localhost:3000/static/js/0.chunk.js:314906:24
at ScrollView (http://localhost:3000/static/js/0.chunk.js:113683:37)
at ScrollView
at StyledNativeComponent (http://localhost:3000/static/js/0.chunk.js:358950:29)
at SearchSuggestions__StyledScrollView
at SearchSuggestions (http://localhost:3000/static/js/main.chunk.js:62877:27)
at InstantSearch (http://localhost:3000/static/js/0.chunk.js:259495:23)
at form
at P (http://localhost:3000/static/js/0.chunk.js:353453:8)
at SearchLanding (http://localhost:3000/static/js/main.chunk.js:66173:55)
at Search (http://localhost:3000/static/js/main.chunk.js:65889:24)
at ErrorBoundary (http://localhost:3000/static/js/0.chunk.js:253671:35)
at withErrorBoundary(Unknown)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at StyledNativeComponent (http://localhost:3000/static/js/0.chunk.js:358950:29)
at withScreenWrapper__View
at ComponentWithScreenWrapper (http://localhost:3000/static/js/main.chunk.js:44339:54)
at StaticContainer (http://localhost:3000/static/js/0.chunk.js:52912:16)
at EnsureSingleNavigator (http://localhost:3000/static/js/0.chunk.js:52573:23)
at SceneView (http://localhost:3000/static/js/0.chunk.js:52796:21)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at CardSheet (http://localhost:3000/static/js/0.chunk.js:63170:22)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at AnimatedComponent (http://localhost:3000/static/js/0.chunk.js:327913:173)
at AnimatedComponentWrapper
at Dummy (http://localhost:3000/static/js/0.chunk.js:61818:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at AnimatedComponent (http://localhost:3000/static/js/0.chunk.js:327913:173)
at AnimatedComponentWrapper
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at Card (http://localhost:3000/static/js/0.chunk.js:62444:171)
at CardContainer (http://localhost:3000/static/js/0.chunk.js:62904:33)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at NativeScreen (http://localhost:3000/static/js/0.chunk.js:310686:171)
at AnimatedComponent (http://localhost:3000/static/js/0.chunk.js:327913:173)
at AnimatedComponentWrapper
at MaybeScreen (http://localhost:3000/static/js/0.chunk.js:62331:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at MaybeScreenContainer (http://localhost:3000/static/js/0.chunk.js:62321:22)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at Background (http://localhost:3000/static/js/0.chunk.js:56545:20)
at CardStack (http://localhost:3000/static/js/0.chunk.js:63337:171)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at SafeAreaProviderCompat (http://localhost:3000/static/js/0.chunk.js:57581:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at StackView (http://localhost:3000/static/js/0.chunk.js:63770:171)
at http://localhost:3000/static/js/0.chunk.js:54341:13
at StackNavigator (http://localhost:3000/static/js/0.chunk.js:61378:17)
at SearchStackNavigator (http://localhost:3000/static/js/main.chunk.js:44376:31)
at ErrorBoundary (http://localhost:3000/static/js/0.chunk.js:253671:35)
at withErrorBoundary(Unknown)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at StyledNativeComponent (http://localhost:3000/static/js/0.chunk.js:358950:29)
at withScreenWrapper__View
at ComponentWithScreenWrapper (http://localhost:3000/static/js/main.chunk.js:44339:54)
at StaticContainer (http://localhost:3000/static/js/0.chunk.js:52912:16)
at EnsureSingleNavigator (http://localhost:3000/static/js/0.chunk.js:52573:23)
at SceneView (http://localhost:3000/static/js/0.chunk.js:52796:21)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at Background (http://localhost:3000/static/js/0.chunk.js:56545:20)
at Screen (http://localhost:3000/static/js/0.chunk.js:57637:107)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at NativeScreen (http://localhost:3000/static/js/0.chunk.js:310686:171)
at AnimatedComponent (http://localhost:3000/static/js/0.chunk.js:327913:173)
at AnimatedComponentWrapper
at MaybeScreen (http://localhost:3000/static/js/0.chunk.js:52032:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at MaybeScreenContainer (http://localhost:3000/static/js/0.chunk.js:52021:22)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at SafeAreaProviderCompat (http://localhost:3000/static/js/0.chunk.js:57581:23)
at BottomTabView (http://localhost:3000/static/js/0.chunk.js:51861:29)
at http://localhost:3000/static/js/0.chunk.js:54341:13
at BottomTabNavigator (http://localhost:3000/static/js/0.chunk.js:51003:17)
at TabNavigator
at ErrorBoundary (http://localhost:3000/static/js/0.chunk.js:253671:35)
at withErrorBoundary(Unknown)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at StyledNativeComponent (http://localhost:3000/static/js/0.chunk.js:358950:29)
at withScreenWrapper__View
at ComponentWithScreenWrapper (http://localhost:3000/static/js/main.chunk.js:44339:54)
at StaticContainer (http://localhost:3000/static/js/0.chunk.js:52912:16)
at EnsureSingleNavigator (http://localhost:3000/static/js/0.chunk.js:52573:23)
at SceneView (http://localhost:3000/static/js/0.chunk.js:52796:21)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at CardSheet (http://localhost:3000/static/js/0.chunk.js:63170:22)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at AnimatedComponent (http://localhost:3000/static/js/0.chunk.js:327913:173)
at AnimatedComponentWrapper
at Dummy (http://localhost:3000/static/js/0.chunk.js:61818:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at AnimatedComponent (http://localhost:3000/static/js/0.chunk.js:327913:173)
at AnimatedComponentWrapper
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at Card (http://localhost:3000/static/js/0.chunk.js:62444:171)
at CardContainer (http://localhost:3000/static/js/0.chunk.js:62904:33)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at NativeScreen (http://localhost:3000/static/js/0.chunk.js:310686:171)
at AnimatedComponent (http://localhost:3000/static/js/0.chunk.js:327913:173)
at AnimatedComponentWrapper
at MaybeScreen (http://localhost:3000/static/js/0.chunk.js:62331:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at MaybeScreenContainer (http://localhost:3000/static/js/0.chunk.js:62321:22)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at Background (http://localhost:3000/static/js/0.chunk.js:56545:20)
at CardStack (http://localhost:3000/static/js/0.chunk.js:63337:171)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at SafeAreaProviderCompat (http://localhost:3000/static/js/0.chunk.js:57581:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at StackView (http://localhost:3000/static/js/0.chunk.js:63770:171)
at http://localhost:3000/static/js/0.chunk.js:54341:13
at StackNavigator (http://localhost:3000/static/js/0.chunk.js:61378:17)
at http://localhost:3000/static/js/1.chunk.js:1065:31
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at StyledNativeComponent (http://localhost:3000/static/js/0.chunk.js:358950:29)
at withWebWrapperweb__SiteContainer
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at StyledNativeComponent (http://localhost:3000/static/js/0.chunk.js:358950:29)
at withWebWrapperweb__SiteWrapper
at ComponentWithWebWrapper
at main
at http://localhost:3000/static/js/0.chunk.js:319476:25
at StyledNativeComponent (http://localhost:3000/static/js/0.chunk.js:358950:29)
at RootNavigator__Main
at _TabNavigationStateProvider (http://localhost:3000/static/js/main.chunk.js:44596:57)
at RootNavigator (http://localhost:3000/static/js/1.chunk.js:1075:40)
at EnsureSingleNavigator (http://localhost:3000/static/js/0.chunk.js:52573:23)
at BaseNavigationContainer (http://localhost:3000/static/js/0.chunk.js:52231:27)
at ThemeProvider (http://localhost:3000/static/js/0.chunk.js:58585:20)
at NavigationContainerInner (http://localhost:3000/static/js/0.chunk.js:57999:25)
at AppNavigationContainer (http://localhost:3000/static/js/1.chunk.js:405:37)
at Suspense
at ScreenErrorProvider (http://localhost:3000/static/js/main.chunk.js:19482:23)
at OnboardingWrapper (http://localhost:3000/static/js/main.chunk.js:71398:23)
at SubscriptionContextProvider (http://localhost:3000/static/js/main.chunk.js:30842:23)
at CulturalSurveyContextProvider (http://localhost:3000/static/js/main.chunk.js:18402:23)
at SnackBarProviderComponent (http://localhost:3000/static/js/main.chunk.js:106906:23)
at SearchWrapper (http://localhost:3000/static/js/main.chunk.js:63891:23)
at SearchAnalyticsWrapper (http://localhost:3000/static/js/main.chunk.js:76169:23)
at FavoritesWrapper (http://localhost:3000/static/js/main.chunk.js:20696:23)
at AccessibilityFiltersWrapper (http://localhost:3000/static/js/main.chunk.js:4519:23)
at LocationWrapper (http://localhost:3000/static/js/main.chunk.js:83191:23)
at ErrorBoundary (http://localhost:3000/static/js/0.chunk.js:253671:35)
at AuthWrapper (http://localhost:3000/static/js/main.chunk.js:5687:23)
at GoogleOAuthProvider (http://localhost:3000/static/js/0.chunk.js:64189:23)
at SettingsWrapper (http://localhost:3000/static/js/main.chunk.js:5826:23)
at QueryClientProvider (http://localhost:3000/static/js/0.chunk.js:339008:21)
at ReactQueryClientProvider (http://localhost:3000/static/js/main.chunk.js:85880:23)
at div
at http://localhost:3000/static/js/0.chunk.js:319476:25
at NativeSafeAreaView (http://localhost:3000/static/js/0.chunk.js:310158:23)
at SafeAreaProvider (http://localhost:3000/static/js/0.chunk.js:310320:24)
at StyledNativeComponent (http://localhost:3000/static/js/0.chunk.js:358950:29)
at react-native-save-area-providerweb__SafeAreaProvider
at SupportedBrowsersGate (http://localhost:3000/static/js/main.chunk.js:129078:23)
at ThemeProvider (http://localhost:3000/static/js/0.chunk.js:358925:76)
at ThemeProvider (http://localhost:3000/static/js/main.chunk.js:86895:23)
at Le (http://localhost:3000/static/js/0.chunk.js:353370:67)
at ThemeProvider (http://localhost:3000/static/js/main.chunk.js:86862:23)
at ServiceWorkerProvider (http://localhost:3000/static/js/main.chunk.js:129395:23)
at RemoteConfigProvider (http://localhost:3000/static/js/main.chunk.js:82236:39)
at App (http://localhost:3000/static/js/main.chunk.js:66:24)

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.

馃攳 Steps to reproduce

clone this repo: https://github.com/pass-culture/pass-culture-app-native
run: git checkout PC-27546/fix-algolia-search
run: yarn
run: yarn start:web:testing
(be carefull and do not share your location)
got to search
click on the search box

This probleme appear in file src/features/search/components/SearchSuggestions/SearchSuggestions.tsx line 103

Live reproduction

/

馃挱 Expected behavior

not to crash

Package version

"@algolia/client-search": "^4.23.3", "algoliasearch": "^4.23.3", "instantsearch.js": "^4.66.1", "react-instantsearch": "^7.7.1", "react-instantsearch-core": "^7.7.1", "search-insights": "^2.13.0"

Operating system

macOs 14.4

Browser

arc, chrome

Code of Conduct

  • I agree to follow this project's Code of Conduct

@TristanMaurier98 TristanMaurier98 added the triage Issues to be categorized by the team label Apr 15, 2024
@Vikas-singh-0

This comment was marked as off-topic.

@TristanMaurier98

This comment was marked as off-topic.

@Vikas-singh-0

This comment was marked as off-topic.

@Haroenv
Copy link
Contributor

Haroenv commented Apr 15, 2024

More info for who will debug this: previous version was 7.1.0, for InstantSearch.js that means 4.57.0->4.66.1, helper 3.14.2->3.17.0

I don't yet have an idea what could cause this change in behaviour though, I don't see those parts of the code as being changed in that version range on first glance

@TristanMaurier98
Copy link
Author

Bump anyone has taken the subject ?

Haroenv added a commit that referenced this issue May 13, 2024
Because React props are not writable, behaviour inside _parseNumbers > merge in the helper requires the configure props to be writable.

fixes #6136

This bug is reproducible by simply rendering `<Configure aroundRadius="all" />` or any other numeric (https://github.com/algolia/instantsearch/blob/d1aa720c8e4e1aad2d7b64e385a29b258240c7df/packages/algoliasearch-helper/src/SearchParameters/index.js#L239-L251) key as a non-number string.
Haroenv added a commit that referenced this issue May 14, 2024
* fix(Configure): prevent aroundRadius="all" throwing

Because React props are not writable, behaviour inside _parseNumbers > merge in the helper requires the configure props to be writable.

fixes #6136

This bug is reproducible by simply rendering `<Configure aroundRadius="all" />` or any other numeric (https://github.com/algolia/instantsearch/blob/d1aa720c8e4e1aad2d7b64e385a29b258240c7df/packages/algoliasearch-helper/src/SearchParameters/index.js#L239-L251) key as a non-number string.

* chore(bundlesize): update limit

This seems to be needed because the location of the babel helpers needs to change to support this new usage of spread.

I don't see any rhyme or reason to why it actually happens or why that has such a large impact for just moved code, but the babel helpers clearly are already very inefficient (many duplicates of the same helper functions) that this probably is fixed if we take a look later to improve this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants