Next.js Discord

Discord Forum

search functionality doesnt work in deployed in nextjs app but works locally

Unanswered
Singapura posted this in #help-forum
Open in Discord
SingapuraOP
TLDR: in my deployed app the network tab shows me it doesnt actually return "tickets?query=test" it returns "tickets" after. the url is correct with the query is correct, its just the network tab.

ive kinda identified the problem, but idk why its different in local env and deployed env.

so the first screenshot is my network tab in my local, and the second is my deployed app. my search functionality that uses query returns the tickets correcly, but in my deployed app it doesnt work and it always returns the same results. which im guesssing is because after the query=test it fetches for tickets after again, although this doesnt happen locally. and idk what would cause my deployed app to fetch for tickets after searching?

heres the code repo. the files that are interesting is prob

app/(routes)/tickets/page.tsx which uses searchparams to find specific tickets
actions/get-tickets which is the function that fetches the tickets
components/ticket-search-form which is the component that is used to set the search query in the url
https://github.com/mariangle/ticketshopr

0 Replies