Search params are removed in production unless useSearchParams
is called
#42438
Labels
area: app
App directory (appDir: true)
useSearchParams
is called
#42438
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next start, Vercel
Describe the Bug
Search params seem to be removed in production unless
useSearchParams
hook is called somewhere.next dev
seems to work fine. Bug occurs withnext build
andnext start
.Expected Behavior
Expected search params to not be removed in production unless
useSearchParams
hook is called.Link to reproduction
https://github.com/LukasMurdock/next-13-test
To Reproduce
Create a page in Next 13
/app
that does not useuseSearchParams
hook anywhere and runnext build
andnext start
and attempt to load the page with any search parameters. Search parameters should be removed.If you add a call
useSearchParams()
then search params are not removed.I have a reproduction here:
useSearchParams()
, params retained) https://next-13-test-kohl.vercel.app/client/work/?test=The text was updated successfully, but these errors were encountered: