Giter Site home page Giter Site logo

Comments (6)

ivan119 avatar ivan119 commented on July 17, 2024 1

Here was my solution

const route = useRouter().currentRoute.value

const id = route.params.id

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

from twitter-clone.

isimmons avatar isimmons commented on July 17, 2024

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.

from twitter-clone.

87nehal avatar 87nehal commented on July 17, 2024

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

from twitter-clone.

edwardz8 avatar edwardz8 commented on July 17, 2024

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 :)

from twitter-clone.

Hi99s avatar Hi99s commented on July 17, 2024

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

from twitter-clone.

87nehal avatar 87nehal commented on July 17, 2024

from twitter-clone.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.