Home > Net >  Cannot do git push to heroku with parse error
Cannot do git push to heroku with parse error

Time:04-30

I'm getting a parse error when I try to push to Heroku. Heroku tells me exactly what is the cause of the error, but I couldn't find what is wrong... How do I fix package.json file to overcome this error. Thank you in advance.

After "git push heroku master"

Enumerating objects: 128, done.
Counting objects: 100% (128/128), done.
Delta compression using up to 8 threads
Compressing objects: 100% (111/111), done.
Writing objects: 100% (128/128), 162.25 KiB | 8.54 MiB/s, done.
Total 128 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote:        1. heroku/nodejs
remote:        2. heroku/ruby
remote: -----> Node.js app detected
remote: parse error: Expected separator between values at line 15, column 19
remote:  !     Unable to parse package.json
remote:
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: b3c6397d182444e7dcae0a097773f19a122763b1
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version b3c6397d182444e7dcae0a097773f19a122763b1
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to t-bear0513.
remote:
To https://git.heroku.com/t-bear0513.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/t-bear0513.git'

{ "name": "heroku_deploy_app", "private": true, "dependencies": { "@rails/actioncable": "^6.0.0", "@rails/activestorage": "^6.0.0", "@rails/ujs": "^6.0.0", "@rails/webpacker": "4.3.0", "turbolinks": "^5.2.0" }, "version": "0.1.0", "engines": { "node": "14.16.1" }, "devDependencies": { "webpack-dev-server": "^4.8.1" }, }

CodePudding user response:

Try to change the node version you are using, something like this:

  "engines": {
    "node": "14.x"
  },

Also make sure it match the version you are using locally

  • Related