vercel / next.js

The React Framework
https://nextjs.org
MIT License
126.78k stars 26.95k forks source link

Cannot set property attribute on metadata using generateMetadata API #64252

Open o-su opened 6 months ago

o-su commented 6 months ago

Link to the code that reproduces this issue

https://github.com/o-su/nextjs-metadata-bug

To Reproduce

  1. start application
  2. open HTML source code

Current vs. Expected behavior

New metadata API does not support setting property attribute on metadata tags. Example: <meta property="fb:app_id" content="FB_APP_ID">

"other" section generates metadata tags only with name attribute: other: { 'fb:app_id': 'FB_APP_ID' }, converts to: <meta name="fb:app_id" content="FB_APP_ID"> // incorrect

Provide environment information

"next": "14.1.4",

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

Metadata (metadata, generateMetadata, next/head)

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

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

Additional context

No response

kevinmmarlow commented 6 months ago

This also breaks Farcaster frames, which require a property and content field instead of a name and content field.

Parth-Flutch commented 6 months ago

+1

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!

hishamank commented 4 months ago

I found this PR that would solve that issue https://github.com/vercel/next.js/pull/66996