Skip to content

[react-instantsearch-nextjs] - NextJS App Router double server side calls #6457

Answered by Haroenv
wesleyjanse asked this question in Q&A
Discussion options

You must be logged in to vote

Indeed, we were just made knowledge of this and I've been working on a solution. For now a workaround is manually enabling a cache that you clear on every page load (to prevent memory pressure or leaks).

The implementation for app router can be seen here: https://github.com/algolia/instantsearch/pull/6456/files#diff-22a1bfe50b37796a54cfc70812b508ee6c4938bf92ecdb3a3b36dedfa1541237

note that this PR also includes a fix that ensures the user token is always consistent, so you may want to cherry-pick that fix in your site already

Hope that helps!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wesleyjanse
Comment options

@Haroenv
Comment options

Answer selected by wesleyjanse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants