hydration error on amending columns definition in data table #4130
SgtErnestBilko
started this conversation in
General
Replies: 1 comment
-
For all that land here........I am not convinced this i a hydration issue but given my issue's simlarity to other problems (stack overflow) I decided to try a hydration error solutionl. See https://stackoverflow.com/questions/77763766/next-js-hydration-error-with-shadcn-dialog-component and https://nextjs.org/docs/messages/react-hydration-error I implemented the dynamic import solution by changing the following code:
Great ...... no hydration issues |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I followed the Data Table instructions (https://ui.shadcn.com/docs/components/data-table) down to an including render the table.
This works well.
However if I amend / add any columns in the columns definition I get a hydration error. For example
If I change the header name to New_name; the page refreshes and momentarily displays the new header (or any other change I make) then reverts to some previous cached version of the page and I get the hydration error "Warning: Text content did not match. Server: "New_Name" Client: "Name""
I have tried "empty cache and hard reload" in the browser (Chrome v126), Disable cache in the developer tools network tab, closing and reopening the browser, deleting the .next folder (I'm using nextJS v14.2), stopping and restarting the development server, defining 'stale times: dynamic" as 0 but nothing seems to clear the client cache I still get the same hydration issue.
The only cure is to leave the development server running and return later (I have not experimented to see how long) after which a page refresh sees "New_Name" being accepted on both client and server with no hydration issue.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions