Skip to content

Data Validation Issue When Modifying the Address Bar in Next.js 14 #7288

Answered by Sevansi
Sevansi asked this question in Q&A
Discussion options

You must be logged in to vote

I found the problem, and on one hand, I'm glad, but on the other, I'm disappointed that I now need to rewrite 20 requests. :) The issue lies with Next.js, specifically in their new approach where you can use requests on the server side in a regular file using 'use server'—I forgot what this approach is called. The problem is that it breaks any requests if they happen simultaneously and there is a change in the address bar. I tried writing my function through fetch to the data retrieval function where 'use server' is used and got the same behavior as with tanstack-query. The solution is very simple: use API routes for data retrieval. In this case, both tanstack-query and fetch, and everyth…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@TkDodo
Comment options

@Sevansi
Comment options

@Sevansi
Comment options

@Sevansi
Comment options

Answer selected by Sevansi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants