Dev admin panel stuck loading

default discord avatar
BlairC99
4 weeks ago
25

I've just installed payload on a fresh ubuntu install and when i access the admin panel from my laptop it gets stuck with the loading screen over the welcome page. has anyone ever had this before?


im accessing the dev page at

http://(internalIP):3000/admin

instead of the cli's localhost:3000/admin

  • default discord avatar
    noheadphones
    4 weeks ago

    Is this deployed on a server? The browser console should give you some information, though I'd bet it's CORS

  • default discord avatar
    BlairC99
    4 weeks ago

    yeh its on ubuntu 22.04 server



    in a proxmox VE host

  • default discord avatar
    noheadphones
    4 weeks ago

    Set a

    cors

    and

    csrf

    config in your payload config


    https://payloadcms.com/docs/configuration/overview#options
    https://payloadcms.com/docs/authentication/overview#csrf-protection


    set it to * for testing but after that you wanna set it to your actual domain names

  • default discord avatar
    BlairC99
    4 weeks ago

    should that be generated automatically or do i need to generate it from scratch?

  • default discord avatar
    noheadphones
    4 weeks ago

    yeah you should have a

    payload.config.ts

    in

    src

    ?



    did you install payload from a template?

  • default discord avatar
    BlairC99
    4 weeks ago

    i installed a blank project template from the installer



    so i assume that file will be blank

  • default discord avatar
    noheadphones
    4 weeks ago

    let me see

  • default discord avatar
    BlairC99
    4 weeks ago

    when i run nano ./src/payloadconfig.ts i get this

  • default discord avatar
    noheadphones
    4 weeks ago

    ok yeah it generates a usable base payloadconfig



    in there you wanna add ^ the cors/csrf configuration

  • default discord avatar
    BlairC99
    4 weeks ago

    ahh okay



    got it now



    so like this?



    image.png
  • default discord avatar
    noheadphones
    4 weeks ago

    inside the buildConfig that's already provided



    but yes

  • default discord avatar
    BlairC99
    4 weeks ago

    so here

    image.png
  • default discord avatar
    noheadphones
    4 weeks ago

    also your serverUrl needs to be your ip:3000

  • default discord avatar
    BlairC99
    4 weeks ago

    and then when it moved to prod it will be the external domain name and i change the CSRF and the CORS to the external domain name

  • default discord avatar
    noheadphones
    4 weeks ago

    yes

  • default discord avatar
    BlairC99
    4 weeks ago

    Thanks paul, im in now

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.