On my last post I explained how to create a full-stack webapp with Node.js, React.js and MongoDB.
Now I am going to show how to deploy this app to ...
For further actions, you may consider blocking this person and/or reporting abuse
Hi,
Nice article. but after added "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client" i cant deploy code on heroku it is giving me error like "failed to push some refs to my application"
and if i remove this line then its deploy successful but at that time site not working. So can you tell me why is this happening?
Thanks,
Dilip
Hi Dilip,
This error usually happens when there are some conflicts while pushing to heroku, I am not sure if that is because of the environment variable.
Could you tell me what do you get in your logs on Heroku?
You can retrieve the logs going to the root of your project and using the following command:
heroku logs --tail
Hi thiago, good post!
i have a problem. the deploy in heroku and connection its ok, but when i tried make petitions to the backend, i recived a 503 unavailable.
I have the settings from the previous post...
Hi Leo, thank you!
Usually when you get error 503 is because there was something wrong with the deployment.
You can use the heroku logs to check what happened:
Take a look at the docs here for more info:
devcenter.heroku.com/articles/logging
Nice article. What is the point of the NPM_CONFIG_PRODUCTION flag, and when does it get set to true?
Thank you, Daniel.
The NPM_CONFIG_PRODUCTION is used in case you need access to packages declared under devDependencies in a different buildpack or at runtime.
Then when your app is ready for production it is better to set it to true.
I've read that mLab is being deprecated in favor of MongoDB Atlas. Is this true?
Yes, that is true.
MLab was bought by MongoDB Inc, so they are working on migrating everything.
But mLab is still supported on Heroku.
You can have more information here blog.mlab.com/2018/10/mlab-is-beco...
Seems that once you add mLab you need to add a user and edit your config
It should not be necessary, once mLab provides us with an environment variable on Heroku settings automatically.
hi,thiago my react app runs perfectly i wrote
"build": "concurrently \"npm run start\" \"cd webpage && npm install && npm run start\"" this helped me in building app locally but when i deploy on heroku it says concurent not found
Hi Thiago,
Now heroku not allowing to add mLab MongoDB addon.
And I need to why we need to add it? can't we just manually input the db url as config variable inside heroku?
I can't express all my thanks for this post and the previous one. Thank you very much!
Thank you Daniel, it makes me really happy that you liked it!!!