Skip to content

Investigate delaying asPath values for all build-time exported pages #17143

@ijjk

Description

@ijjk

When a page is exported at build time from either the automatic static optimization or from leveraging getStaticProps the asPath will initially be the pathname since it is the information we have for what the URL should be when visiting the page.

On the client we currently delay updating the asPath for dynamic pages that leverage the automatic static optimization to prevent a hydration mismatch. We should investigate applying this behavior for all build-time exported pages since they can all encounter a hydration mismatch if rewritten to using the rewrites feature and asPath is used while rendering the page.

Original issue opened here #17113 which was initially thought to be related to GS(S)P asPath resolving but is not since the reproduction provided only leverages pages that are automatically statically optimized without GS(S)P methods.

Metadata

Metadata

Assignees

Labels

Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions