useSearchParams
fails when dynamic page performs files operations.
#43113
Labels
bug
Issue was opened via the bug report template.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
When using the hook
useSearchParams
in a client component with theexperimental: {appDir: true}
setting next build does not generate some static assets that are required such as images. This can be seen when runningpostbuild
scripts likenext-sitemap
or by deploying in vercel, the page will not render and fail with a frontend error.But in the functions tab in vercel the following error is generated.
It also should be noted that this only happens when the
useSearchParams
hook is used in the page or layout tree. I suspect it's an issue with the edge-function runtime however it only happens when a client side component is added.Expected Behavior
The page should pre-render correctly and perform properly.
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://github.com/kochie/next-bug-reproduction-navigation-search-params
To Reproduce
/will-fail/page-1
will cause a render failure.Alternatively clone the repo and deploy yourself, navigating to the
will-fail
pages will cause server side errors, whilewill-succeed
pages will work.The text was updated successfully, but these errors were encountered: