Build failing when deploying to Heroku

HI,

Any help would be much appreciated.

I’m running docker on Wappler 5.0.2 using a Mac M1. I can successfully deploy on my local docker instance and everything works fine.

However, my deployment is failing when publishing to Heroku. I’m using a Heroku Postgres DB also.
Can anyone point me in the right direction?

-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  >=12.13.0
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version >=12.13.0...
       Downloading and installing node 18.7.0...
       Using default npm version: 8.15.0
       
-----> Restoring cache
       - npm cache
       
-----> Installing dependencies
       Installing node modules
       npm ERR! code EUSAGE
       npm ERR! 
       npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
       npm ERR! 
       npm ERR! Missing: pg@8.7.3 from lock file
       npm ERR! Missing: buffer-writer@2.0.0 from lock file
       npm ERR! Missing: packet-reader@1.0.0 from lock file
       npm ERR! Missing: pg-pool@3.5.1 from lock file
       npm ERR! Missing: pg-protocol@1.5.0 from lock file
       npm ERR! Missing: pg-types@2.2.0 from lock file
       npm ERR! Missing: pgpass@1.0.5 from lock file
       npm ERR! Missing: pg-int8@1.0.1 from lock file
       npm ERR! Missing: postgres-array@2.0.0 from lock file
       npm ERR! Missing: postgres-bytea@1.0.0 from lock file
       npm ERR! Missing: postgres-date@1.0.7 from lock file
       npm ERR! Missing: postgres-interval@1.2.0 from lock file
       npm ERR! Missing: split2@4.1.0 from lock file
       npm ERR! Missing: xtend@4.0.2 from lock file
       npm ERR! 
       npm ERR! Clean install a project
       npm ERR! 
       npm ERR! Usage:
       npm ERR! npm ci
       npm ERR! 
       npm ERR! Options:
       npm ERR! [--no-audit] [--foreground-scripts] [--ignore-scripts]
       npm ERR! [--script-shell <script-shell>]
       npm ERR! 
       npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
       npm ERR! 
       npm ERR! Run "npm help ci" for more info
       
       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.gWwwq/_logs/2022-08-04T10_31_37_106Z-debug-0.log
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       Some possible problems:
       
       - Dangerous semver range (>) in engines.node
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

I am not an expert, but I have deployed to Heroku. One thing to check is if your Heroku nodeJS & DB settings are exactly the same as your project setup.

Heroku recommends specifying the exact version of Node.js, Yarn, or npm that you are using locally in the engines field - https://help.heroku.com/0ZIOF3ST/why-is-my-node-js-build-failing-because-of-an-invalid-semver-requirement

I ended up going with Docker for now, even though I’d been using Heroku prior to learning Wappler. Heroku was too expensive in my opinion for what ended up being a bit of a bumpy ride (and if it isn’t going to be smooth, I’d rather pay less and fix stuff myself)

Edit to add: @byrnejamoe If you have the account permissions in Heroku, you can also try upgrading the Heroku database or app platform (or both) to a newer version without doing anything to your Wappler file. I notice that Heroku’s defaults are a few versions older than Wappler’s defaults. If you do this, just deploy again from Wappler after the upgrade completes on the Heroku site. On our Heroku plan, one could roll back if you didn’t like the upgrade – not sure if that is universal, so if this project is live, proceed with caution :slight_smile: