DEV Community

Discussion on: How to deploy a Laravel/Vue App to Heroku

Collapse
 
smplyjr profile image
Jr Flores • Edited

Still getting the error after adding the scripts. And what npm run build supposed to be doing? Laravel's package.json scripts by default only has dev, watch and prod.

I am not sure if build is an old key for prod. Please correct me if I'm wrong.

Thread Thread
 
axis80 profile image
axis80 • Edited

I got it working using this:

    "postinstall": "npm run production",
    "heroku-prebuild": "npm install -f",
    "heroku-postbuild": "npm run production"
Enter fullscreen mode Exit fullscreen mode

That rebuilt the assets multiple times, so I trimmed it down to just this and it seems to be all that is needed. At least, it is working for me now:

"heroku-postbuild": "npm run production"
Enter fullscreen mode Exit fullscreen mode