-
Notifications
You must be signed in to change notification settings - Fork 177
Description
When setting up next.config rewrites, they don't seem to be playing nicely with query parameters with pages router (Could be app router as well, but untested)
Versions
Next version: 5.2.1
Open-next version: 3.5.1
Here's an example rewrites I've put together;
http://github.com/nicholas-c/next-15-open-next-example/
const nextConfig: NextConfig = {
reactStrictMode: true,
async rewrites() {
return [
{
source: "/about",
destination: "/",
},
{
source: "/account/register",
destination: "/api/auth?tab=register",
},
{
source: "/account/login",
destination: "/api/auth",
},
];
}
}
Locally this works as intended, both with yarn dev and yarn start and yields the expected results.
However when built and deployed with Open-next the query parameter gets lost.
https://next-15-en.nich-carter-qza3ng.gymshark-sandbox.tools/account/register
https://next-15-en.nich-carter-qza3ng.gymshark-sandbox.tools/api/auth?tab=register
Additionally to this, because I'm piggy backing on a previous test repo I have for this; When I add back in i18n config into next.config /account/register starts to 404 in the example above.