garmeeh / next-seo

Next SEO is a plug in that makes managing your SEO easier in Next.js projects.
MIT License
7.57k stars 391 forks source link

Bug: <DefaultSeo /> OG image does not get added to pages with <NextSEO/> #1279

Open JakeSchroeder opened 1 year ago

JakeSchroeder commented 1 year ago

I would expect by using Default NextSEO like the docs say:

_app.tsx
...
<DefaultSeo
        openGraph={{
          type: 'website',
          locale: 'en_US',
          images: [{ url: https://mywebsite.com/social-card-main.png }],
        }}
 />      

Would populate pages that implement without the OG Image

about.tsx
...

<NextSEO
        title="About - My Website"
        description="My cool website"
        canonical="https:/mywebsite/about"
/>

But it doesn't work. In other words, wherever you merge the props you should only override used props and not unused like og image in this case. Now I have to explicitly set each pages og image.

qnrjs42 commented 1 year ago

same issue

"next-seo": "^6.1.0"

andrekutianski commented 1 year ago

I would expect by using Default NextSEO like the docs say:

_app.tsx
...
<DefaultSeo
        openGraph={{
          type: 'website',
          locale: 'en_US',
          images: [{ url: https://mywebsite.com/social-card-main.png }],
        }}
 />      

Would populate pages that implement without the OG Image

about.tsx
...

<NextSEO
        title="About - My Website"
        description="My cool website"
        canonical="https:/mywebsite/about"
/>

But it doesn't work. In other words, wherever you merge the props you should only override used props and not unused like og image in this case. Now I have to explicitly set each pages og image.

This occurs with any default props. I believe that this override (and some cases overrides by NextJS like #1134 ) is due to where you define the DefaultSEO.

Documentation shows an old way to declare a custom container to wrap an app with SEO.