-
Notifications
You must be signed in to change notification settings - Fork 525
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
React InstantSearch NextJS not compatible with NextJS 15 (stable release as of 10/21): Not handling async request apis #6409
Comments
these are the headers being used: should be awaited before using its value. info: https://nextjs.org/docs/messages/sync-dynamic-apis |
Maybe will it be fixed here? |
It's not there |
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 |
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! |
I managed to fix this by manually declaring and defining the types in the
This ensures that TypeScript recognizes these components and provides proper type checking and IntelliSense support, this is likely a temporary solution until the library maintainers update their type definitions to be compatible with the latest Next.js and TypeScript versions. @Haroenv hopefully this will be helpful for future references to this issue |
🐛 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: