Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: (using Next.js, TanstackQuery, Axios) Server returns Old data, even after deleting content from the database. Fresh data is only fetched after rebuilding vercel deployment. #2

Closed
ChiragChrg opened this issue Dec 27, 2023 · 1 comment
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right question Further information is requested

Comments

@ChiragChrg
Copy link
Owner

The code seems to work correctly in local development server, but after deploying on vercel it appears that the data is cached and the same data is returned on every request. Even after deleting/adding some data to mongodb the data does not update.
I have tried disabling all caching methods on fetching, added queryCache.clear() from TanstackQuery and disabled 'Vercel Data Cache', it did not resolve the issue.
The fresh data is fetched only after redeplying the site on vercel.

@ChiragChrg ChiragChrg added bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right question Further information is requested labels Dec 27, 2023
@ChiragChrg ChiragChrg self-assigned this Dec 27, 2023
@ChiragChrg ChiragChrg reopened this Jan 6, 2024
@ChiragChrg
Copy link
Owner Author

Fixed issue by switching data fetching to server Actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant