SearchParams works well in local but not in production #55737
-
|
I am trying to use app router using Search Params. Here some code you can see It works well in local routes such as : but doesn't seems to be working in production routes such as: Keep in mind, I deployed my NextJs app to AWS. so if there's something I need to configure in AWS kindly let me know or if I am doing it wrong way, please elaborate! Looking forward to hear. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
|
Maybe you have some kind of redirect? I think sometimes a redirect might not carry over the query parameters. |
Beta Was this translation helpful? Give feedback.
-
|
@mkalsi25 How did you fix it? |
Beta Was this translation helpful? Give feedback.
-
with the help of If still doesn't work, please share your case with good explaination / or maybe share code. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
i am having the same problem... the app works on localhost but not when i deploy: import { useMutation } from "convex/react"; // Dynamically import Map with SSR disabled interface DashboardProps { const Dashboard = ({ searchParams }: DashboardProps) => { const sp = useSearchParams() useEffect(() => { const isEmptySearchParams = !searchParams.search && !searchParams.filter; return ( ); }; export default Dashboard; the isEmptySearchParams is false when is i do filters and searches on localhost but not on production as it state it is undefined... and remains to true |
Beta Was this translation helpful? Give feedback.
Thank you for your response.
use of NEXTJS Link and useRouter fixed this issue for me. I was using window.open(url, _self) (not sure why it is not working with it but anyways my issue is solved!)