I just deployed my project to cloud but it stays in deployment screen for 1 day
Hi @muper what is your project name? we'll look into this, definitely shouldn't be taking that long to deploy
Also do your build logs say successful at the bottom of that tab?
karency
it says build failed
Am I need to delete the project?!
Can you screenshot and send in the error if it shows one on that screen?
sure
In your package json file, you have a
build
script right?
I Do have
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
the problem is I don't have access to payload UI to do that part
it's in loading session
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
ok but can you please delete it for me first?
absolutely - I've just deleted it for you, the project should be gone from your payload UI now if you refresh
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?
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
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
yeah probably a result of the yarn / npm switch
let us know if you run into any other problems
sure thanks for support
happy to help!
we have this error now
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?
yes for sure
let me check npm locally
it's done locally
no problem
okay great - can you confirm that the environment variables you entered when deploying this project are the same as your local environment?
these 2 was my ENV
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.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.