Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Can't deploy to render

default discord avatar
marygracee3 years ago
18

I don't really know what to do. I'm honestly at a loss, dealing with this for hours

  • discord user avatar
    alessiogr
    3 years ago

    I've never used render, but this looks like it didn't run yarn build beforehand

  • default discord avatar
    marygracee3 years ago

    error changes, now it says i don't have the secret key



    lemme check the env variables on render



    (comunque grazie, almeno l'errore e cambiato ahah)

  • discord user avatar
    alessiogr
    3 years ago

    Yup, it'd need a PAYLOAD_SECRET environment variable



    (i think the payload secret can be anything)

  • default discord avatar
    marygracee3 years ago

    yeah, im trying with the env inserted.



    ill let you know in a moment





    new error



    (i have the mongo url in env variables)



    ok, the site is live. Is it normal that it's just a white page?

  • discord user avatar
    alessiogr
    3 years ago

    nope, check the execution log - maybe some problem connecting to mongodb again

  • default discord avatar
    marygracee3 years ago

    nope, it says connected to mongo



    https://backendblog.onrender.com/admin
  • discord user avatar
    alessiogr
    3 years ago

    ah



    set the environment variable PAYLOAD_PUBLIC_BASE_DNS to your domain



    so backendblog.onrender.com

  • default discord avatar
    marygracee3 years ago

    ill give this a try



    If this doesn't work im gonna just follow the tutorial you mentioned and in case ill ask other questions

  • discord user avatar
    alessiogr
    3 years ago

    you can find it here:

    https://northflank.com/guides/deploying-payload-cms#initiate-the-payload-project

    might help with your render deployment as well ^^

  • default discord avatar
    marygracee3 years ago

    when i set the server url to that env variable, it gives me this error



    [20:12:48] ERROR (payload): There were 1 errors validating your Payload config


    Nov 22 09:12:48 PM [20:12:48] ERROR (payload): 1: Your serverURL cannot have a path. It can only contain a protocol, a domain, and an optional port.



    (im sorry, i really am stupid lol)

  • discord user avatar
    alessiogr
    3 years ago

    what exactly did you set as environment variable?

  • default discord avatar
    marygracee3 years ago

    In the .env file, i set

    http://localhost:3000

    In the website



    I set the website url

  • discord user avatar
    alessiogr
    3 years ago

    it needs to be just

    PAYLOAD_PUBLIC_BASE_DNS=backendblog.onrender.com
  • default discord avatar
    marygracee3 years ago

    in render.com



    yeah, it's like that



    in the config file it's process.env.PAYLOAD_PUBLIC_BASE_DNS

  • discord user avatar
    alessiogr
    3 years ago

    Ah I think the protocol is missing



    try

    PAYLOAD_PUBLIC_BASE_DNS=https://backendblog.onrender.com
  • default discord avatar
    marygracee3 years ago


    however...still white page..

  • discord user avatar
    alessiogr
    3 years ago

    Ah did you add www. to the environment variable? Cause it needs to be without www

  • default discord avatar
    marygracee3 years ago

    ...ok.



    it works...



    grazie veramente, scusa per la perdita di tempo

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.