Problems with implementing the SEO Plugin

default discord avatar
falko100
12 months ago
1 1

When implementing the SEO plugin I am getting a TypeScript error.
Can anyone point me at my mistake?

My payload.config.ts:

export default buildConfig({
  // Ommited because out of context
  plugins: [
    seo({
      collections: ['pages'],
      uploadsCollection: 'images',
    }),
  ],
});

The error:
TS2322: Type '(config: Config) => Config' is not assignable to type 'Plugin'.   Types of parameters 'config' and 'config' are incompatible.

  • discord user avatar
    DanRibbens
    Payload Team
    12 months ago

    I don't think the type error you shared is coming from the plugins of your config.

    To rule this out, what happens if you comment out the plugins from your config, does the error go away?

    I just createed a new Payload TS project and added the seo plugin and it is working with your exact plugins config. I can push to a sample repo if it helps or you can go look at the public-demo too.

    Happy to help more if you can share the rest of your config or more specific lines of code to look at.

    2 replies
  • default discord avatar
    falko100
    12 months ago

    It does go away when I comment it out. I'll investigate a bit more and will let you know.

  • default discord avatar
    falko100
    12 months ago

    Yep, I tried as they have it in the demo and it works perfectly. Thanks. 😩

Open the post
Continue the discussion in GitHub
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.