You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NextJS 15 became the official release on Monday, but InstantSearch Next doesn't work with the new asynchronous request apis causing several errors. InstantSearchNext.tsx and useInstantSearchRouting.ts both access headers incorrectly. Didn't see any references to Next15 compatibility in any issues or PRs, so wanted to open this up for people in the same boat as me.
🔍 Steps to reproduce
Setup NextJS project
Use React InstantSearch NextJS
Error!
Live reproduction
N/A
💭 Expected behavior
N/A
Package version
react-instantsearch-nextjs 0.3.15
Operating system
All
Browser
All
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
We'd be happy to look into a solution for this, and also accept a community PR. For now it seemed complex as the places we're using the headers are synchronous and early in the life cycle, so it's not clear where it should become asynchronous
It makes sense. Maybe the way to go with it is to pass headers as a prop to InstantSearchNext. I took a quick look, and I believe this could be the easiest way to go. I'm not sure if React.use() will work given the scenario, and I don't think we can make InstantSearchNext a server component, right @Haroenv?
The component indeed needs to be mounted client-side as well so it can't be server-only. Passing headers top-level could be an option. If you pass headers, the synchronous calls could be conditional and there won't be a warning anymore right?
If that works, we'd be happy to receive a pull request that accepts "static" headers as alternative to reading them synchronous already. Thanks!
🐛 Current behavior
NextJS 15 became the official release on Monday, but InstantSearch Next doesn't work with the new asynchronous request apis causing several errors. InstantSearchNext.tsx and useInstantSearchRouting.ts both access headers incorrectly. Didn't see any references to Next15 compatibility in any issues or PRs, so wanted to open this up for people in the same boat as me.
🔍 Steps to reproduce
Live reproduction
N/A
💭 Expected behavior
N/A
Package version
react-instantsearch-nextjs 0.3.15
Operating system
All
Browser
All
Code of Conduct
The text was updated successfully, but these errors were encountered: