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

Static rendering does not work with nextjs 15. #1593

Closed
3 tasks done
islamBelabbes opened this issue Dec 3, 2024 · 3 comments
Closed
3 tasks done

Static rendering does not work with nextjs 15. #1593

islamBelabbes opened this issue Dec 3, 2024 · 3 comments
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@islamBelabbes
Copy link

Description

Static rendering does not seem to work with Next.js 15

I have cloned the example repo, and I did run the Next.js 15 upgrade command.
npx @next/codemod@canary upgrade latest

Next.js logs show that the pages are static, but they are not.

I have tried both with and without generateStaticParams()

Verifications

Mandatory reproduction URL

https://github.com/islamBelabbes/example-app-router-nextjs15-static

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. run npm npm build
  3. Math.random() value on home pge changes on every request

Expected behaviour

home page should be static (Math.random() value should not change on every request.)

@islamBelabbes islamBelabbes added bug Something isn't working unconfirmed Needs triage. labels Dec 3, 2024
@amannn
Copy link
Owner

amannn commented Dec 4, 2024

There's a PR where I've updated all examples to Next.js 15: #1089

I've just added Math.random() there to verify and static rendering definitely works for me there. Can you compare with the implementation of example-app-router there to see if you can spot a difference?

Screenshot 2024-12-04 at 11 26 12

@islamBelabbes
Copy link
Author

islamBelabbes commented Dec 4, 2024

Great, it's working fine.
the issue in the prev example was that not-found.tsx was using the BaseLayout which is dynamic by default.

@amannn
Copy link
Owner

amannn commented Dec 4, 2024

Ah yes, that's a really weird bug indeed! I've mentioned this in #1089 and opened vercel/next.js#71623. With rootParams on the horizon, I hope that we'll soon be able to support static rendering much more easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants