next.js: [NEXT-1189] metadata not updated on navigation with `experimental.serverActions` set to true

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
Binaries:
  Node: 18.16.0
  npm: 9.6.5
  Yarn: 1.22.19
  pnpm: 8.4.0
Relevant packages:
  next: 13.4.1
  eslint-config-next: 13.4.1
  react: 18.2.0
  react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true), Metadata (metadata, generateMetadata, next/head, head.js)

Link to the code that reproduces this issue

https://github.com/TheEdoRan/nextjs-metadata-bug

To Reproduce

  • Create a Next project
  • Set experimental.serverActions to true in next.config.js
  • Export metadata objects from pages
  • Use <Link> to navigate between them

Describe the Bug

When enabling experimental.serverActions flag in next.config.js, metadata updating on navigation breaks. The first time you navigate to a page it works as it should, but then if you try again it breaks and meta tags stay the same.

Expected Behavior

Meta tags are updated on navigation.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-1189

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 37
  • Comments: 15 (5 by maintainers)

Commits related to this issue

Most upvoted comments

This issue will be fixed by #51779.

It’s not helpful to reply with “I also have this issue”, for things that are already recognized as a bug with assignee. It won’t help addressing the root cause, and will only increase the number of notifications for maintainers (so they spend more time reading them, and less time fixing the actual thing). To express the need of a fix you can react with an emoji (👍), or you can provide a helpful reproduction or even try to share you findings.

Thank you!

Tip: If the issue is open, it’s unfortunately not fixed yet.

You don’t have to add additional comments saying “Version x” has the same, because the issue is open, the special case is if the issue is fixed but still open, then it’s useful to post a comment saying it has been fixed. Saying it still happens on an open issue needlessly pings everyone on the thread.

Alternatively you can provide additional reproductions if they’re different from the initial post that provides a reproduction.

Thank you!

There’s a commit after PR merge that reverts React update. Do we have to reopen this issue?

v13.4.9 fixed the problem…

@TheEdoRan is right. thanks…

I have the same issue!

Since #51779 was closed, here’s the new followup PR from @styfle:

I also have the same issue! - Using Next.js (“next”: “^13.4.4”,)

May be fixed by #52282, not sure

I also have the same issue! - Using Next.js (“next”: “^13.4.6”,)

After some tests, I found out that this bug first appeared in version 13.3.5-canary.6