Comments (6)
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.
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.
@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.
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.
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.
from twitter-clone.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter-clone.