Facing issues with the react instantsearch upgradation from v6 to v7

We are using a monorepo structure. In one package, we are developing React components in that we are developing algolia facets. In these components, we have utilized Instant Search hooks. In another package, we have a Next.js project. In this Next.js project, we have an Instant Search component. Within the Instant Search component, we are using React components that we previously developed in the mentioned earlier package.
However, at the moment, we are encountering an error: ‘Error: Invariant failed.

If you want to look the project architecutre, please provide us the github username or email we will share you the github mock project.

Can you please provide us the solution for this.

Thanks In Advance