After reinstalling Payload I get weird errors

default discord avatar
artmelkon
last month
8

After reinstalling payload I get these 3 messages that doesn't make sense to me, however when I checked the payload.config.js file it seams config module is missing or could be something else not sure. All the lines have red error underlines. How to get this fixed, the code used to work fine before re-installation.

  • discord user avatar
    denolfe
    Payload Team
    last month

    Hey @artmelkon , were you on Payload 1.0 previously? It looks like this project is now on 2.0 with a 1.0 config. Is that the case?

  • default discord avatar
    artmelkon
    last month

    Yes, it was



    I managed it working now



    But I think there might need some correction. After moving bunlder into admin and fixing db: mongooseAdapter({url: proessess.env.MY_DB})

  • discord user avatar
    denolfe
    Payload Team
    last month

    Are you getting an error? Could you explain more?

  • default discord avatar
    artmelkon
    last month

    I was getting buy after these fixes I don't get any for now, it connected smoothly

  • discord user avatar
    denolfe
    Payload Team
    last month

    Great to hear 👍

  • default discord avatar
    artmelkon
    last month

    First it was complaining about the DB url, as I mentioned above, after checking your code I made some corrections to the config file and the connection was successful.



    The second error was about bunder, and after reading the error I realized that it should be moved from top tier into admin{}, and that was my final change to the config file

  • discord user avatar
    denolfe
    Payload Team
    last month

    Awesome



    For anyone else stumbling upon this thread. The write-up for upgrading to 2.0 is located here:

    https://github.com/payloadcms/payload/releases/tag/v2.0.0
  • default discord avatar
    fatso8855
    last month

    I'm also running into similar issues. I've read the release notes and am none the wiser.



    I get the following output when running the migrate script:



    [23:46:56] ERROR (payload): There were 5 errors validating your Payload config
    [23:46:56] ERROR (payload): 1: Collection "pages" > Field "blocks" > "value" does not match any of the allowed types
    ...
    [23:46:56] ERROR (payload): 5: Collection "questions" > Field "faqs" > "value" does not match any of the allowed types


    The first error relates to this I believe:



    /collections/pages.ts:


    fields: [
    ...
    {
          name: "blocks",
          type: "blocks",
          blocks: [
            ReusableContent, 
            FAQcontent, 
            ...
            Hero,      
          ],
        },
    ]
Open the post
Continue the discussion in Discord
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.