Step by Step Guide for Deploying a Vue App to Heroku
This Vue JS tutorial walks through the steps necessary to deploy a a Vue CLI version 3 app to Heroku. This includes showing how to fix routing issues related to single page applications in production.
The deployment checklist is:
- Add a start command to the package.json file
- Remove the /dist directory from .gitignore
- Install express
- Setup a server.js file
- Run ‘npm run build’ to build the production code
- Deploy to Heroku
Show notes and code: https://rails.devcamp.com/vue-js-development/vue-cli-upgrade-deployment/vue-cli-heroku-deployment-guide
GitHub link: https://github.com/jordanhudgens/vue-cli-three-heroku-template
Hello,
thanks for uploading such a great content, tho I am really frustrated as I am trying to deploy my vue app to heroku for almost three days and it just doesn’t want to go through,
the app gets rendered perfectly fine using the development mode by running `npm run serve`, however, when I run the app using the Express.js, exactly like you did in the video, even when i run node server.js to test the server.js file locally, i get an error to the console
the error is :
Cannot set property ‘render’ of undefined with a bunch of links with paths to my node_modules folder.
I literally tried to find an answer to this everywhere with no results.
Hi,
I am unable to deploy my code on heroku. no build errors unable to figure out. Followed all the above steps. here is my github : https://github.com/shrutigv/Baaruni-sharma. Help much appreciated. Thanks in advance 🙂