algolia / instantsearch

⚑️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.

Home Page:https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NextJS - `createURL` should run server side

avremel opened this issue Β· comments

πŸ› Current behavior

createURL returns an empty URL on the server and only populates on the client.

πŸ” Steps to reproduce

  1. Go the sandbox
  2. Disable Javascript
  3. Observe that the links are empty
Screen Shot 2023-05-31 at 12 09 06 PM

Live reproduction

https://codesandbox.io/p/sandbox/refinement-list-sort-issue-forked-i8kn3o?file=%2Fcomponents%2FRefinementList.js%3A9%2C11

πŸ’­ Expected behavior

Expect that the links are populated server side. Theoretically this should be possible since we are running getServerState on the server and know the UI state prior to SSR. (See #5236 (comment)).

Package version

algoliasearch 4.17.1, react-instantsearch-hooks-web 6.44.0

Operating system

Mac 11.6.5

Browser

Chrome 113.0.5672.126

Code of Conduct

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

A side effect of this issue: When you click on a link before the JS is fully loaded, you are taken to the broken link.

Hi @avremel,

Closing this as it's a duplicate of #5236. The fix is coming soon and we'll communicate about it there !