payload icon indicating copy to clipboard operation
payload copied to clipboard

plugin-seo: PayloadCMS SEO Plugin Causes UI Crash When Editing Documents

Open jimzer opened this issue 2 years ago • 1 comments

Hi everyone : )

Thanks for the amazing work done on PayloadCMS!

I'm trying to use the payloadcms SEO plugin (official one), but when I add it it breaks the UI. Here is my config:

import seo from "@payloadcms/plugin-seo";
import path from "path";
import { buildConfig } from "payload/config";
import { Articles } from "./collections/Articles";
import { Categories } from "./collections/Categories";
import { Media } from "./collections/Media";
import { ProgrammingLanguages } from "./collections/ProgrammingLanguages";
import { Tags } from "./collections/Tags";
import { Users } from "./collections/Users";

export default buildConfig({
  admin: {
    user: Users.slug,
  },

  collections: [Users, Articles, Media, Tags, Categories, ProgrammingLanguages],
  localization: {
    locales: ["en", "fr"],
    defaultLocale: "en",
    fallback: true,
  },
  typescript: {
    outputFile: path.resolve(__dirname, "payload-types.ts"),
  },
  graphQL: {
    schemaOutputFile: path.resolve(__dirname, "generated-schema.graphql"),
  },
  plugins: [
    seo({
      collections: ["articles"],
      uploadsCollection: "media",
      tabbedUI: true,
      generateTitle: ({ doc }) => "",
      generateDescription: ({ doc }) => "",
    }),
  ],
});

When I try to edit an article, the UI crashed directly with this error:

iUncaught TypeError: Cannot read properties of null (reading 'useState')
    at useState (react.development.js:1622:1)
    at Overview (Overview.js:35:1)
    at renderWithHooks (react-dom.development.js:16305:1)
    at mountIndeterminateComponent (react-dom.development.js:20074:1)
    at beginWork (react-dom.development.js:21587:1)
    at beginWork$1 (react-dom.development.js:27426:1)
    at performUnitOfWork (react-dom.development.js:26557:1)
    at workLoopSync (react-dom.development.js:26466:1)
    at renderRootSync (react-dom.development.js:26434:1)
    at recoverFromConcurrentError (react-dom.development.js:25850:1)

jimzer avatar Sep 07 '23 17:09 jimzer

Hey @jimzer - are you still facing this issue?

If so, can you pull down the latest version of the seo plugin for me and see if it resolves?

e.g. npm install @payloadcms/plugin-seo or yarn add @payloadcms/plugin-seo

PatrikKozak avatar Dec 18 '23 22:12 PatrikKozak

@jimzer going to close this for now since it's not reproducible. If you're still experiencing issues after updating the plugin to its latest version and can create a reproducible repo for me, I'll reopen and look back into it!

PatrikKozak avatar Jan 02 '24 20:01 PatrikKozak