Deployment Process Stays At Screen

default discord avatar
muper
7 months ago
44

I just deployed my project to cloud but it stays in deployment screen for 1 day

  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    Hi @muper what is your project name? we'll look into this, definitely shouldn't be taking that long to deploy

  • default discord avatar
    Jarrod
    7 months ago

    Also do your build logs say successful at the bottom of that tab?

  • default discord avatar
    muper
    7 months ago

    karency



    it says build failed



    Am I need to delete the project?!

  • default discord avatar
    Jarrod
    7 months ago

    Can you screenshot and send in the error if it shows one on that screen?

  • default discord avatar
    muper
    7 months ago

    sure



    image.png
  • default discord avatar
    Jarrod
    7 months ago

    In your package json file, you have a

    build

    script right?

  • default discord avatar
    muper
    7 months ago

    I Do have



    image.png
  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    We have found that if your project contains a

    package-lock.json

    file, DigitalOcean assumes

    npm

    by default (mentioned in the error logs) and the default payload build settings use

    yarn

    unless you change them.



    So you can fix this error two ways:


    - remove the package-lock.json file and use yarn.lock


    - update the build commands in the payload UI (from yarn to npm)



    We will look to improve this in the future by adding checks to detect npm / yarn use 👍 Let us know if this works for you

    Screen_Shot_2023-04-18_at_1.09.23_PM.png
    Screen_Shot_2023-04-18_at_1.09.49_PM.png
  • default discord avatar
    muper
    7 months ago

    the problem is I don't have access to payload UI to do that part



    it's in loading session



    image.png
  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    Unfortunately you'll need to create / deploy the project again - we will push an update soon to exposing the settings during deployment so that you have access to it in the future

  • default discord avatar
    muper
    7 months ago

    ok but can you please delete it for me first?

  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    absolutely - I've just deleted it for you, the project should be gone from your payload UI now if you refresh

  • default discord avatar
    muper
    7 months ago

    yeah, it's gone, thank you by the way





    actually I deployed a new one, but I have this problem in deployment



    my port is 3000 in server file and my env file is also the same as my another project in payload which was successful



    can you please delete this project for me again?

    image.png
  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    hey @muper yes I can delete it for you - looks like the

    npm build

    command is causing the error and needs to be updated to

    npm run build


    project should be gone now, just deleted

  • default discord avatar
    muper
    7 months ago

    yes I didn't have this problem with my previous project, don't know why this happened here, maybe it's because of the yarn and npm



    sure thank you i'll try again

  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    yeah probably a result of the yarn / npm switch



    let us know if you run into any other problems

  • default discord avatar
    muper
    7 months ago

    sure thanks for support

  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    happy to help!

  • default discord avatar
    muper
    7 months ago


    we have this error now

    image.png
  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    looking into it



    strange... just to check the basics here, you do have a

    payload.config

    file in your src folder? and when you

    npm run build

    locally, does this error happen?

  • default discord avatar
    muper
    7 months ago

    yes for sure



    let me check npm locally



    it's done locally



    no problem

  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    okay great - can you confirm that the environment variables you entered when deploying this project are the same as your local environment?

  • default discord avatar
    muper
    7 months ago


    these 2 was my ENV

    image.png
  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    that looks right, this is an odd error but we're trying to figure it out now



    In your

    src

    folder, do you have a .npmrc file? if so, follow these steps:


    - delete your .npmrc file


    - delete your node_modules folder


    - delete your yarn.lock file


    - rerun npm install locally



    Then commit these changes to your repo, the commit will trigger a redeploy and then we'll check if the build error is gone.



    We were able to replicate and it appears to be a conflict with using

    .npmrc

    to handle legacy dependancies and the npm version that digital ocean runs. The steps above fixed the error for us.

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.