vercel / next.js

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

Metadata API Not Working #46875

Closed rohanreddy888 closed 1 year ago

rohanreddy888 commented 1 year ago

Verify canary release

Provide environment information

I have added the Metadata OG in the page.tsx the content of the data and not showing on any of the OG Checkers.

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/Quillhash/QuillAudits-next-js

To Reproduce

Describe the Bug

I have added the Metadata OG in the page.tsx the content of the data and not showing on any of the OG Checkers.

Expected Behavior

The contents of the Meta tag should showup in the https://www.opengraph.xyz/

Which browser are you using? (if relevant)

Brave

How are you deploying your application? (if relevant)

Vercel

rohanreddy888 commented 1 year ago

PrevIous Scape FireShot Capture 005 - Sharing Debugger - Meta for Developers - developers facebook com

After Updating Next Version (With Head.JS) FireShot Capture 006 - Sharing Debugger - Meta for Developers - developers facebook com

rohanreddy888 commented 1 year ago

With MetaData og:image missing FireShot Capture 007 - Sharing Debugger - Meta for Developers - developers facebook com

balazsorban44 commented 1 year ago

The reproduction is private, and no environment information was provided

github-actions[bot] commented 1 year ago

We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate.

Why was this issue marked with the please add a complete reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository (template), but you can also use a tool like CodeSandbox or StackBlitz.

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue.

Please test your reproduction against the latest version of Next.js (next@canary) to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

What happens if I don't provide a sufficient minimal reproduction?

Issues with the please add a complete reproduction label that receives no meaningful activity (e.g. new comments with a reproduction link) are automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please do not comment "I have the same issue" without reproduction steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

joulev commented 1 year ago

In the latest version of Next.js at least you can add og:image just fine (#46570) so this is 99% a bug in your code... For the record open graph is working perfectly in my website also using metadata.

rohanreddy888 commented 1 year ago

In the latest version of Next.js at least you can add og:image just fine (#46570) so this is 99% a bug in your code... For the record open graph is working perfectly in my website also using metadata.

Do you mean add image in the openGraph object like this?

export const metadata: Metadata = {
  title: 'Web3 Hack Statistics, Hackerboard - QuillAudits',
  description:
    'Get statistics and deep analysis of recent crypto hacks, vulnerabilities, and attack vectors around the web3 world.',
  openGraph: {
    title: 'Web3 Hack Statistics, Hackerboard - QuillAudits',
    url: 'https://www.quillaudits.com/tools/hackerboard',
    description:
      'Get statistics and deep analysis of recent crypto hacks, vulnerabilities, and attack vectors around the web3 world.',
    image: 'https://quillaudits.com/api/og?amount=6B&number=1000',
    images: [
      {
        url: 'https://quillaudits.com/api/og?amount=6B&number=1000',
        secureUrl: 'https://quillaudits.com/api/og?amount=6B&number=1000',
        alt: 'Web3 Hack Statistics, Hackerboard - QuillAudits',
        width: 1200,
        height: 630,
        type: 'image/png',
      },
    ],
    locale: 'en-US',
    type: 'website',
  },
  alternates: {
    canonical: 'https://www.quillaudits.com/tools/hackerboard',
  },
  twitter: {
    card: 'summary_large_image',
    title: 'Web3 Hack Statistics, Hackerboard - QuillAudits',
    description:
      'Get statistics and deep analysis of recent crypto hacks, vulnerabilities, and attack vectors around the web3 world.',
    creator: '@QuillAudits',
    images: ['https://quillaudits.com/api/og?amount=6B&number=1000'],
  },
  robots: {
    index: true,
  },
};
balazsorban44 commented 1 year ago

@rohanreddy888 please make your repo public. :pray: (or create a minimal public reproduction).

rohanreddy888 commented 1 year ago

@rohanreddy888 please make your repo public. 🙏 (or create a minimal public reproduction).

Hey @balazsorban44 , I have tried to create a new next project and add the metadata its working. But its not working on my current project.

joulev commented 1 year ago

Doesn't that confirm it's your code's bug and not a Next.js bug?

rohanreddy888 commented 1 year ago

Doesn't that confirm it's your code's bug and not a Next.js bug?

Nope that doesn't answer there should be some error show where the issue is and why its not working.

Franetse7 commented 1 year ago
Ok understand Je suis Francisco, le staticien De : Rohan ReddyEnvoyé le :mardi 7 mars 2023 16:45À : vercel/next.jsCc : SubscribedObjet :Re: [vercel/next.js] Metadata API Not Working (Issue ***@***.*** please make your repo public. 🙏 (or create a minimal public reproduction).Hey @balazsorban44 , I have tried to create a new next project and add the metadata its working. But its not working on my current project.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***> 
rohanreddy888 commented 1 year ago

After 5 hours of debugging found the problem with the my custom tracking code i had in the project once i removed it its working fine now. But dont know how that is connected to the Metadata API. If you guys have any idea reply here. Thank you.

Confuze commented 1 year ago

Do you think this could be at all related to #46899?