nextjs - 💡(How to fix) Fix OG rendering SVG title element [3 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#88097Fetched 2026-04-08 02:05:32
View on GitHub
Comments
3
Participants
2
Timeline
9
Reactions
0
Timeline (top)
commented ×3mentioned ×2subscribed ×2cross-referenced ×1

Fix Action

Fix / Workaround

We have this in production over at www.gredice.com/opengraph-image We applied opacity workaround. Version doesn't seem to be an issue, it was present in 15 too.

Code Example

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.1
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 16.1.1-canary.12 // Latest available version is detected (16.1.1-canary.12).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/cool-darkness-679p3h

To Reproduce

  1. Start the application in development or production mode
  2. Navigate to /opengraph-image

Current vs. Expected behavior

Expect only the SVG to render, not the title element that is there for a11y.

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.1
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 16.1.1-canary.12 // Latest available version is detected (16.1.1-canary.12).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Not sure

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

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

Additional context

We enabled biome checking and fixed reported a11y issues with SVGs missing title by adding the title element to the SVGs. We now see title is rendered in OG.

<img width="852" height="250" alt="Image" src="https://github.com/user-attachments/assets/04e068b5-d677-45d0-84cd-aff40ffa114b" />

We have this in production over at www.gredice.com/opengraph-image We applied opacity workaround. Version doesn't seem to be an issue, it was present in 15 too.

extent analysis

TL;DR

The issue can be fixed by adjusting the CSS to hide the title element from being rendered in the OpenGraph image.

Guidance

  • Review the CSS styles applied to the title element within the SVG to ensure it is not being inadvertently displayed.
  • Verify that the opacity workaround previously applied is correctly hiding the title element in the OpenGraph image.
  • Check the Next.js configuration and the SVG rendering logic to ensure that the title element is not being explicitly rendered.
  • Consider adding a CSS rule to specifically target and hide the title element within the OpenGraph image context.

Example

No specific code example can be provided without more details on the current implementation, but a possible solution could involve adding a CSS rule like .opengraph-image title { display: none; } to hide the title element.

Notes

The issue seems to be related to the rendering of the title element within the OpenGraph image, which is intended for accessibility purposes but should not be visually displayed. The provided information does not specify the exact CSS or rendering logic in use, so the guidance is focused on general troubleshooting steps.

Recommendation

Apply a targeted CSS workaround to hide the title element in the OpenGraph image context, as the issue does not seem to be version-specific and was present in previous versions of Next.js.

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

nextjs - 💡(How to fix) Fix OG rendering SVG title element [3 comments, 2 participants]