Skip to content
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

Layout shift while rendering on hard navigation from 14.2.2 #65796

Open
navin-moorthy opened this issue May 15, 2024 · 1 comment
Open

Layout shift while rendering on hard navigation from 14.2.2 #65796

navin-moorthy opened this issue May 15, 2024 · 1 comment
Labels
bug Issue was opened via the bug report template. Navigation Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@navin-moorthy
Copy link

Link to the code that reproduces this issue

https://github.com/navin-moorthy/next.js-layout-shift-from-14.2.2

To Reproduce

  1. Check the next version - next": "14.2.2
  2. Run npm run dev
  3. Go to HomePage /
  4. Go to AboutPage /about
  5. Hard refresh
  6. Go to Homepage '`'
  7. To reproduce again, Hard refresh
  8. Go to AboutPage /about

You will be able to see the footer and then render the page.tsx contents both on HomePage and AboutPage

Repeat above steps if it's not visible.

Current vs. Expected behavior

Current next": "14.2.2 & above

Footer will be rendered below Header and then the contents from page.tsx pushed down the Footer.

NOTE: Also checked future versions including canary versions)

I tried best but I couldn't capture that frame in a video recording.
But here's the same version to reproduce,

2024-05-15.at.19.42.07.-.Magenta.Jaguar.mp4

Expected next": "14.2.1

NOTE: Make sure to clear next folder, after changing the versions

In this version, you don't see any layout shifts.

Footer will be rendered properly and then the contents from page.tsx replaced the Footer.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.12.0
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 14.2.2 // There is a newer version (14.2.3) available, upgrade recommended! 
  eslint-config-next: 14.2.3
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

NOTE: Happens everywhere

Which area(s) are affected? (Select all that apply)

Navigation

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

No response

@navin-moorthy navin-moorthy added the bug Issue was opened via the bug report template. label May 15, 2024
@github-actions github-actions bot added the Navigation Related to Next.js linking (e.g., <Link>) and navigation. label May 15, 2024
@navin-moorthy
Copy link
Author

navin-moorthy commented May 22, 2024

Here's an update on reproduction in my local,

bug-reproduction.mp4

At 0:08, That specific frame where we get the empty page,

in-slow-motion.mp4
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

1 participant