Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

React Instantsearch Hooks: SSR not working on v6.27.0 #3511

Closed
francisconeves97 opened this issue Jun 12, 2022 · 6 comments · Fixed by #3518
Closed

React Instantsearch Hooks: SSR not working on v6.27.0 #3511

francisconeves97 opened this issue Jun 12, 2022 · 6 comments · Fixed by #3518

Comments

@francisconeves97
Copy link

francisconeves97 commented Jun 12, 2022

🐛 Bug description

SSR with Next.js is not working on the latest version of react-instantsearch-hooks-web and react-instantsearch-hooks-server (6.27.0). Every element that is rendered inside the <InstantSearch /> component is only rendered on the client side,

🔍 Bug reproduction

Steps to reproduce the behavior:

  1. Clone the hooks-ssr example: https://github.com/algolia/react-instantsearch/tree/v6.22.0/examples/hooks-ssr
  2. Change the react-instantsearch-hooks, react-instantsearch-hooks-server and react-instantsearch-hooks-web dependencies version from 6.22.0 to 6.27.0
  3. Install the npm dependencies
  4. Start the server
  5. Verify that no search results were server side rendered by checking the html source

Live reproduction:

https://codesandbox.io/s/github/algolia/react-instantsearch/tree/v6.27.0/examples/hooks-next?file=/package.json

💭 Expected behavior

The widgets inside the <InstantSearch /> should be server side rendered

Environment

  • React InstantSearch Hooks version: 6.27.0
  • React version: 17.0.2

Additional context

Tried to downgrade to version 6.26.0 and the search results are server side rendered, so the issue should have been introduced on the last release

@francisconeves97 francisconeves97 changed the title SSR not working on v6.27.0 React Instantsearch Hooks: SSR not working on v6.27.0 Jun 12, 2022
@dominiksipowicz
Copy link

I can confirm and reproduce the SSR bug. It's working on the previous version 6.26.0

It can be tested by simply disabling JavaScript in Google Chrome (Settings -> Prefrences -> Debugger -> Disable JavaScript)

@Haroenv
Copy link
Contributor

Haroenv commented Jun 13, 2022

This is very surprising, as on a quick glance, the only relevant change happened in 6.25.0 with 0a13867, otherwise also InstantSearch.js was updated between 6.26.0 and 6.27.0

Thanks for reporting this, we are investigating further!

@francoischalifour
Copy link
Member

The issue comes from #3489. We identified the problem and have a fix for this. We're currently writing more integration tests to make sure this doesn't happen again. You can expect a fix in the next minor version, we'll ping you here.

Thank you for reporting!

@dominiksipowicz
Copy link

thanks @francoischalifour, awesome!

@francoischalifour
Copy link
Member

The SSR fix was released in v6.28.0. Thank you all!

@francisconeves97
Copy link
Author

Amazing, thank you!

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

Successfully merging a pull request may close this issue.

4 participants