Home > Back-end >  deploying Node on heroku error after build successful
deploying Node on heroku error after build successful

Time:03-31

i have been trying to deploy a node.js app on heroku. the app run successfully on local machine and it build successful with git heroku push master. but when try to open the app on heroku, it shows a blank page and on the console i got the bellow error. so i my app i uses owlcarousel, and react -carousel. thanks

enter image description here

CodePudding user response:

Try running it locally with NODE_ENV=production node index.js to see if you can reproduce the error like that. Check the .gitignore to see if you are not leaving out some important files. Check the package.json If a module that is included in the package.json is missing from the build or the production app, it may have been removed by Heroku during pruning. And also, in order to create a smaller slug size for apps, the buildpack will prune out the devDependencies from the package.json at the end of the build, so that the slug will only include the dependencies that are listed at runtime. If there is a dependency that is in the devDependencies that is needed after the prune occurs, move the dependency to dependencies, so it is not removed. Look here for more info, troubleshooting Node.js deployment on Heroku.

  • Related