Different behavior of useSWR in production than in development #2712
Unanswered
ricardoc05
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm sharing the frontend and backend code of a react component that uses swr to retrieve data from a table, in that table you can edit the cells and then save the changes to a database, then mutate() is executed with the idea that the changes are reflected in the frontend table. The issue is that in the development environment everything works as expected, the user makes the changes, saves them and then those changes are reflected in the frontend table; but in the development environment when the application is built with npm run build and then executed with npm run start, the changes in the frontend table are reflected in the database but not in the frontend, that is, the original data is reloaded . When the project is launched in Vercel the same thing happens. What could be the problem?
Frontend code:
Backend code
Beta Was this translation helpful? Give feedback.
All reactions