-
Notifications
You must be signed in to change notification settings - Fork 199
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
Issues with live reloading in Next.js #109
Comments
This is something that I have also noticed. I'm guessing that this happening because we fetch the data on the server (via getStaticProps) and then send the data to the Next.js page via props. When the data (from Contentlayer) changes, Next.js "reloads" the page as the data has changed on the server. Because of this "reload", the page scrolls to the top and is unable to maintain the current scroll position. A few more points to note:
|
This problem should now be addressed with version |
@schickling Thank you for the update. I tried the latest version and still faced the same issue. I have replicated the same issue on Stackblitz. |
Thanks a lot @ghoshnirmalya for following up on this. You're right, I was able to reproduce the problem on Stackblitz. However, it seems this is a separate issue (which similar symptoms though). Would you mind creating a new issue for this? 🙏 |
I have a couple issues I can consistently recreate when working with Contentlayer and Next.js. These occur consistently while working on the Contentlayer website.
Reloading Renders the Home Page
Live Reloading with Direct Access
If I reload the docs page I'm working on, then the correct page is reloaded, but it scrolls to the top.
Video
Here's a video of the bug(s) in action:
The text was updated successfully, but these errors were encountered: