Cannot push to Heroku main - sql-server

I'm trying to deploy using Heroku.
When pushing my code to Heroku git through its HTTPS URL, I see an error like this
git push heroku main fatal: unable to access 'https://projectname.herokuapp.com/': The requested URL returned
error: 502
I already removed Heroku and added a new Heroku but it still didn't work. Can anyone help me?
done✔✔✔

You're trying to use the address where your app is hosted as a Git remote:
https://mfal-project.herokuapp.com/
But the address where your app is hosted and the address its Git service uses are different.
Instead of adding the remote manually, I suggest you remove the existing one using git remote rm heroku and then ask the Heroku CLI to add a remote for you:
heroku git:remote -a mfal-project
You should now see a new remote called heroku that looks more like
https://git.heroku.com/mfal-project.git

Related

Deploy strapi and react js to heroku

I have strapi as backend and react js as frontend developed in separate folders. When doing the development from localhost I have to run npm start for both strapi and react js which both running in two different port.
The thing is, I've been asked to deploy my project to heroku but I have no idea on the deployment process as there is no specific tutorial that I can find for that matter. I found this similar issue as mine here How to deploy Strapi backend and ReactJS frontend to a single Heroku app but the solutions given are not clear to follow.
Should I put the strapi and react js in one folder and add the middlewares like in the solution given then only deploy?
The first thing you need to do is to get a CLI instalation on your machine. After that you need to Login on heroku with the following command:
$ heroku login
After you've done this step you need to clone the repository or the remote location in case you have already a git repo on your localmachine as such.
Remember that before this you need to create a Heroku App on heroku.com first. then follow the step.
$ heroku git:clone -a [my-repository-name]
after you are done with this. Commit your project files. as such.
$ git add .
$ git commit -m "my first project commit front end"
$ git push heroku master
You need to make sure that you have a procfile that is needed in order to run the npm run command. so.. create a file called.
Procfile
(this is the name of the file that needs to be behind src file.
After you have done this. You may continue with the next project. example. this would work only for your frontend application. For the backend application you can create another application and repeat the same steps.
web: npm run start

Error pushing ReactJS (CRA template) code to GitHub enterprise

After cloning the empty repository I created in my Github Enterprise account, I created a CRA (create-react-app) ReactJS application. I created, committed & pushed a README.md file before generating the CRA scaffolding and it got pushed successfully. But, after CRA app got generated, I'm not able to push the code to the GitHub Enterprise server.
Git Bash throws the following error:
remote: fatal: early EOF
Whereas GitHub Desktop throws the following:
error: RPC failed; curl 56 Failure when receiving data from the peer
I have been using GitHub enterprise for NodeJS web app dev for years now and have never faced any issue of such sort but I have not been able to push the CRA based React app scaffolding code.
I have tried referring to the following StackOverflow posts:
Your configuration specifies to merge with the <branch name> from the remote, but no such ref was fetched.?
Git push error '[remote rejected] master -> master (branch is currently checked out)'
Cannot push to GitHub - keeps saying need merge
but those didn't work. Apparently, this use case is unique as the error only gets thrown (from all my experience working with this GitHub enterprise account) when I'm pushing CRA code and no other.
Attachments (Git Bash & GitHub Desktop errors):
This has been answered here: https://stackoverflow.com/a/36843260/1673761
Look here: https://flyingtomoon.com/2011/04/12/git-push-is-failed-due-to-rpc-failure-result56/
The problem is most likely because your git buffer is too low.
You will need to increase Git’s HTTP buffer by setting the git config var “http.postBuffer” to 524288000.
git config http.postBuffer 524288000

"Cannot use import statement outside a module" error when deploying to Heroku

I'm fairly new to both development and Heroku but I am working through trying to deploy a react app. I can run the app perfectly fine when I run it locally, however I keep running into issues when I try to deploy to Heroku. It appears to build successfully, however I keep ending up with an application error and when I check the heroku logs I get the following:
heroku logs
When I searched for this syntax error it seems to be pretty popular and it looks like it might have something to do with my index.js file being buried in client -> src -> index.js (I specify this location in my Procfile). What I don't understand though is why this import error doesn't give me any trouble locally, only when I try to push to Heroku.
Edit:
Additional error is logged here. No Demon Errors
I had a similar issue when trying to deploy my first react app to heroku
I found a super simple solution that makes deploying to heroku painless.
Here are the steps I followed to do this:
create-react-app $APP_NAME
cd $APP_NAME
git init
heroku create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildkit.git
git add .
git commit -m "initial commit"
git push heroku master
[https://www.youtube.com/watch?v=zDiQrgeGTuU&t=135s][1] Here is a link to the youtube video I followed.
As far as I can tell the buildpack was the major key here as it did most of the heavy lifting in terms of preparing the app for launch.
I tried this, but got the following error
-----> Building on the Heroku-20 stack
-----> Using buildpack: https://github.com/mars/create-react-app-buildkit.git
! error fetching custom buildpack https://github.com/mars/create-react-app-buildkit.git
! Push failed

Pickup config change from Heroku with mars/create-react-app-buildpack

I currently have a create-react-app deployed on my Heroku server, and I'm using the mars/create-react-app-buildpack.
I would like to be able to change the Heroku REACT_APP_ config variables on Heroku, and have them used in the React App.
Right now, they config variables are only picked up once when I call git push heroku master which means I need to redeploy for the config settings to change.
Has someone been able to find a workaround for this?
I found out this is already handled by #mars/create-react-app-buildpack with runtimes configuration variables.
You can use them in your react app as follows: https://github.com/mikehanssen/create-react-app-buildpack#runtime-configuration.

Pushing react app to Heroku

Ok so I've never actually deployed an app before. I used the create-react-app to create the app, when ready I used npm run build this gives me a build folder but when I try to push the code to my github repo it says everything is up-to-date.
Should I be just concerned with the the build folder now? I tried creating a repo for my build folder and deploying it to Heroku but that didn't work.
I'm not sure how to get my code up to github and then to Heroku if it's saying everything is up to date. Just looking for some feedback here. Haven't really deployed anything before.
Thanks!
You can add the create-react-app-buildpack
Set the buildpack with
heroku buildpacks:set https://github.com/mars/create-react-app-buildpack
Then just push to heroku and you're good to go!
git push heroku master
You need to create an another repo with heroku using their cli and run these commands:
heroku login
heroku create
Then copy the second link which is your heroku git repo and push your code using:
git push heroku master

Resources