nextjs - 💡(How to fix) Fix App Router `generateMetadata` - unfurling does not work in Slack [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#83926Fetched 2026-04-08 02:21:10
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
closed ×1commented ×1issue_type_added ×1labeled ×1

Code Example

As it has to do with the rendered HTML and not the OS itself, this will occur on any operating system so long as the `<head>` content above the `<meta>` tags produces more than 32Kb of data
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://nextjs.org/docs/app/getting-started/metadata-and-og-images#generated-open-graph-images

To Reproduce

Use the generateMetadata function to set opengraph sets the Opengraph tags (like <meta property="og:image" />) too far down in the HTML for Slack's unfurl logic to find it, causing links utilizing generateMetadata to not unfurl properly in Slack

When unfurling, Slack places a 32kb Range HTTP Header, documented in this blog post: https://blog.daveallie.com/slack-link-unfurling/#why-slack-why

In practice, that continue to be how Slack unfurls URLs. Due to this Range limit, the <script ... /> and other tags cause the <meta ...> tags to be past 32KB in the HTML source code of our website pages and so Slack refused to unfurl or show Opengraph Images for any of our pages. There doesn't appear to be a way to override this

Current vs. Expected behavior

One possible solution would be to place the <meta ...> tags related to Unfurling (Such as og:image as close to the top of the <head> as possible so there's much less chance that it doesn't end up in the top 32kb

Provide environment information

As it has to do with the rendered HTML and not the OS itself, this will occur on any operating system so long as the `<head>` content above the `<meta>` tags produces more than 32Kb of data

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

Not sure

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

Other (Deployed), Vercel (Deployed)

Additional context

No response

extent analysis

TL;DR

Move the Opengraph metadata tags, such as <meta property="og:image" />, closer to the top of the HTML <head> section to ensure they are within the 32KB range limit for Slack's unfurl logic.

Guidance

  • Review the generateMetadata function to determine how it inserts Opengraph tags into the HTML and adjust it to place these tags as close to the top of the <head> as possible.
  • Verify the rendered HTML to ensure the Opengraph metadata tags are within the first 32KB of the HTML source code.
  • Consider minimizing or removing unnecessary tags and content in the <head> section to reduce the overall size and improve the chances of the Opengraph tags being within the 32KB limit.
  • Test the changes by sharing a link to the updated page on Slack to see if the unfurling issue is resolved.

Example

No specific code example is provided as the issue is related to the positioning of metadata tags in the HTML, which depends on the implementation of the generateMetadata function.

Notes

This solution assumes that the issue is solely related to the positioning of the Opengraph metadata tags in the HTML and that moving them closer to the top of the <head> section will resolve the unfurling issue on Slack.

Recommendation

Apply workaround: Move the Opengraph metadata tags closer to the top of the HTML <head> section, as this is a feasible solution given the 32KB range limit imposed by Slack's unfurl logic.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING