Skip to content

have to refresh routes on both home and status routes #4

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

Open
edwardz8 opened this issue Aug 21, 2022 · 6 comments
Open

have to refresh routes on both home and status routes #4

edwardz8 opened this issue Aug 21, 2022 · 6 comments

Comments

@edwardz8
Copy link

for any data to appear you have to refresh routes on both home and status routes. hydration error.

Hydration completed but contains mismatches.

@isimmons
Copy link

isimmons commented Nov 16, 2022

I'm also having this issue. After login the first time, the main content area is blank until I refresh. Then when clicking on a tweet, the tweet id is undefined so I see a 500 error from prisma. The main content is blank and then when I refresh, it shows the tweet.

If I go back home and click on another tweet, the first tweet shows because it's cached I guess. And even though the id in the url has changed, it still shows undefined if I console.log(route.params.id)

const route = useRoute();

const getIdFromRoute = () => {
  console.log(route.params.id); // undefined
};

Same issue if creating a tweet from the home page. When it redirects to status/id the id is undefined until page refresh.

I am using nuxt RC 13 so I've been waiting to run into problems eventually, being 10 releases ahead of what is used in the course.

@ghost
Copy link

ghost commented Sep 2, 2023

@isimmons @edwardz8 did you guys find any fixes for the issue, after spending hours I am unable to find any fixes and its disappointing.

@edwardz8
Copy link
Author

edwardz8 commented Sep 5, 2023

here's the repo i created @isimmons that fixed the issue: https://github.com/edwardz8/nuxt3-prisma

i don't remember the exact file(s) that i had to update that fixed the issue as it's been a minute since i've looked at this, but the hydration issue no longer throws the error. good luck :)

@ivan119
Copy link

ivan119 commented Oct 30, 2023

Here was my solution

const route = useRouter().currentRoute.value

const id = route.params.id

"useRoute().params.id" is cached for some reason

@Hi99s
Copy link

Hi99s commented Nov 18, 2023

Here was my solution

const route = useRouter().currentRoute.value

const id = route.params.id

"useRoute().params.id" is cached for some reason

that's quite helpful

@ghost
Copy link

ghost commented Nov 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants