vercel / platforms

A full-stack Next.js app with multi-tenancy and custom domain support. Built with Next.js App Router and the Vercel Domains API.
https://app.vercel.pub
5.38k stars 689 forks source link

middleware file strips search params query params #297

Closed jphyqr closed 9 months ago

jphyqr commented 10 months ago

the middleware rewrite strips off your search params.

return NextResponse.rewrite( new URL(/app${path === "/" ? "" : path}?${url.searchParams}, req.url), );

i added this so that I can have search params in my pages.tsx files.

dunno if any other issues with this, but something to look for

MohJaber93 commented 10 months ago

I am facing this issue too, it works after adding this ?${url.searchParams} to the URL

steven-tey commented 9 months ago

Good point! Just added this line which should fix this: https://github.com/vercel/platforms/blob/main/middleware.ts#L27-L29