[Vuejs]-Unexpected syntax error when Vue app deployed on Heroku

0👍

First I run npm run build… Then I run git push heroku master to deploy it”

Unless you’re not telling us something, npm run build does nothing useful here. git push operates on commits but your generated dist/ files haven’t been committed.

That’s probably okay, though, since Heroku can build your application itself. Add a postinstall script to your package.json file to tell it how:

"scripts": {
  "postinstall": "npm run build"
}

This assumes that your build is actually generating valid output in dist/. If that’s not happening there’s a second problem to deal with.

Leave a comment