Is it possible to get query paramaters with useRouter() when rewriting with _middleware.ts ?
When rewriting through next.config.js as explained here https://nextjs.org/docs/api-reference/next.config.js/rewrites it was possible to get query parameters from useRouter().query but when using rewrites via _middleware.ts with NextResponse.rewrite(path) as shown in this example https://github.com/vercel/examples/blob/main/edge-functions/hostname-rewrites/pages/_middleware.ts useRouter().query is an empty object.
Or is the only way to access paramters from context.params using getStaticProps or getServerSideProps ?
Thanks.
Edit : Seems related to #55 , when I export getStaticProps or getServerSideProps, even without returning context.params useRouter().query is populated but if not I got the error described there and an empty object.