Localhost:3000 Version Displayed Differently from Heroku Deployed Version - Node.js Localhost:3000 Version Displayed Differently from Heroku Deployed Version - Node.js heroku heroku

Localhost:3000 Version Displayed Differently from Heroku Deployed Version - Node.js


If you are sure that the source codes itself are not the same in these two branches, you can use force push:

# Make sure you are on your local master branchgit branch# Make sure that your remote address is correctly setgit remote -v# Then force push your master branch to heroku remote master branchgit push heroku master -f

force pushing a branch to a remote will force the remote branch to take on the branch’s code and git commit history

But if you don't have access to check the source code, check if Environment Variables are the same on local machine and server or not (e.g. NODE_ENV variable)

Moreover, Double check automatic deployment of heroku (if exists) as well as the node and npm version of both machines and be aware of the command you run on both machines (npm start or node . or ...) that may have different operations based on envs or so.


Please check the branch or remote url of heroku.

In heroku click Deploy tab and find out the branch. Add the remote url in your local machine terminal.

1) heroku git:remote -a projectname2) git status3) git add .4) git commit -m "message"5) git push heroku master


Since you are not doing anything obviously wrong, something is wrong.It is hard to say what it is exactly, without additional investigation.

I suggest that you clone your project from heroku into a new directory, then copy your local changes from your local branch (which as you said works on 3000 port) into this fresh directory and push all those changes as usual:

git add -Agit commit -m "some message"git push

It is also a good idea to diff fresh clone with your currently working directory. If tracked files are identical, that would suggest difference between local environment and heroku container configuration.