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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR fails with sortOptions in ReactiveList #1024

Closed
multidis opened this issue Jun 20, 2019 · 2 comments
Closed

SSR fails with sortOptions in ReactiveList #1024

multidis opened this issue Jun 20, 2019 · 2 comments

Comments

@multidis
Copy link

Issue Type: bug

Platform: Web

Description:
When sortOptions prop is passed to ReactiveList it fails with server-side rendering. The error traces to "only used for SSR" - commented code block here.

Uncaught (in promise) TypeError: Cannot read property 'sortOptionIndex' of undefined

options.sort = [(_ref10 = {}, _ref10[props.sortOptions[undefined.sortOptionIndex].dataField] =

Screenshots:

Minimal reproduction of the problem with instructions:

Working example without sortOptions prop (master-branch):
https://github.com/multidis/reactivesearch_gatsby

Failing example with sortOptions prop: switch to the sorting branch where an array or sorting options was added

Reactivesearch version: 3.0.0-rc.15

Browser: [all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Anything else:

This example is based on the following issue originally resolved with reactivesearch v2:
gatsbyjs/gatsby#10556

Relevant stacktrace:

ReactiveList.js:507 Uncaught (in promise) TypeError: Cannot read property 'sortOptionIndex' of undefined
at Object../node_modules/@appbaseio/reactivesearch/lib/components/result/ReactiveList.js.ReactiveList.generateQueryOptions (ReactiveList.js:507)
at index.js:130
at Array.forEach ()
at index.js:103
at new Promise ()
at initReactivesearch (index.js:80)
at SearchReactive._callee$ (SearchReactive.js:63)
at tryCatch (runtime.js:45)
...

@bietkul
Copy link
Contributor

bietkul commented Jun 24, 2019

Thanks for reporting it, it'll be fixed soon.

@arpithparikh
Copy link

This still persists with the SSR Next.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants