Skip to content

Deploy to heroku is not working using yo angular-fullstack:heroku #1966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wikett opened this issue Jun 9, 2016 · 7 comments · Fixed by #2304
Closed

Deploy to heroku is not working using yo angular-fullstack:heroku #1966

wikett opened this issue Jun 9, 2016 · 7 comments · Fixed by #2304

Comments

@wikett
Copy link

wikett commented Jun 9, 2016

Item Version
generator-angular-fullstack 3.7.5
Node 4.4.5
npm 3.9.5
Operating System Windows 7
Item Answer
Transpiler Babel
Markup HTML
CSS SCSS
Router ui-router
Build Tool Grunt
Client Tests Jasmine
DB MongoDB
Auth Y

Hello, I have just created my app, working perfectly in localhost but when I try to deploy to Heroku I have problems.

First of all, using yo angular-fullstack:heroku I get this error:
(!) NamedBase constructor is deprecated. See https://github.com/yeoman/generator /issues/882 ? Name to deploy as (Leave blank for a random name):

How can deploy into Heroku? must I wait when that issue it will be fixed?

I have tried to deploy manually, following the steps: https://github.com/angular-fullstack/generator-angular-fullstack/issues/1920 https://github.com/angular-fullstack/generator-angular-fullstack/issues/1950 but I can't get sorted.

After installing angular-fullstack, have I to create a heroku app?

  1. cd dist
  2. heroku create
  3. git init
  4. git add .
  5. git commit -m "first commit"
  6. git push heroku master
  7. heroku open

Could you explain me the steps to create an app and deploy to heroku instead of using yo angular-fullstack:heroku ??

Thanks in advance

@AmirGilboa
Copy link

look at this:
#1950

check the comment by djpark at the end, it might help you.

@savliv
Copy link

savliv commented Jun 20, 2016

I think your issue is that you are not linking a valid heroku app. In order for your remote to be connected to an application it needs be like follows heroku git:remote -a desolate-ravine-67061, instead of simply heroku create. So, the steps would be:

  1. Go to heroku.com and declare your application manually.
  2. cd dist
  3. add a git remote, which is connected to the app
  4. git add .
  5. git commit -m "first commit"
  6. grunt buildcontrol:heroku

Then, when you want to update the application

  1. cd ..
  2. grunt build
  3. cd dist
  4. git add .
  5. git commit -m "..."
  6. grunt buildcontrol:heroku

That is what I have been doing and it works great!

@bestconsultant
Copy link

Here is the easiest workaround:

After yo has generated the app, go to heroku.com and create and application manually (ex. foo-bar-42424), then starting frome the root foolder run the following commands:

  • grunt build
  • cd dist
  • heroku login (if you are not already authenticated)
  • heroku git:remote -a foo-bar-42424
  • cd ..
  • grunt build (not sure if this one is necessary)
  • grunt buildcontrol:heroku

Done

@jbradstreet
Copy link

jbradstreet commented Jul 9, 2016

Savli's approach worked for me, except for all the grunt commands. I attempted to follow the steps outlined in the "grunt build control" link mentioned here...still no luck.

In the end I used "gulp" instead of "grunt" for all the commands that Savli listed, and it worked!

I still needed to connect my MongoDB, which wasn't straight forward. Couldn't leverage the generator commands, couldn't add it using Heroku's dashboard either. So I'll share how I did it.

To connect MongoDB, I had to set up MongoLab through mLab's website.

  • Create a user with a password
    • (save the password somewhere, you'll need it later when you go to your Heroku app dashboard)
  • Copy the MongoDB URI they provide.
  • Go to your Heroku dashboard.
  • Select your app.
  • Click on "Settings", then click "Reveal Config Vars."
    • Key = MONGODB_URI
    • Value = paste in your copied uri from the mLab website
      • Be sure to change the and parts of the mLab uri with your created user and password.

Hope this helps!

@rohita77
Copy link
Contributor

flaurians instructions should be merged in the Read Me. ,d

aniknafs added a commit to aniknafs/generator-angular-fullstack that referenced this issue Oct 18, 2016
Remove 'yo angular-fullstack:heroku' (not working)
Update docs to reflect manual setup

Fixes: angular-fullstack#1966, angular-fullstack#1950
aniknafs added a commit to aniknafs/generator-angular-fullstack that referenced this issue Oct 18, 2016
Remove 'yo angular-fullstack:heroku' (not working)
Update docs to reflect manual setup

Fixes: angular-fullstack#1966, angular-fullstack#1950
aniknafs added a commit to aniknafs/generator-angular-fullstack that referenced this issue Oct 18, 2016
Remove 'yo angular-fullstack:heroku' (not working)
Update docs to reflect manual setup

Fixes: angular-fullstack#1966, angular-fullstack#1950
aniknafs added a commit to aniknafs/generator-angular-fullstack that referenced this issue Oct 19, 2016
Remove 'yo angular-fullstack:heroku' (not working)
Update docs to reflect manual setup

Fixes: angular-fullstack#1966, angular-fullstack#1950
aniknafs added a commit to aniknafs/generator-angular-fullstack that referenced this issue Oct 19, 2016
Remove 'yo angular-fullstack:heroku' (not working)
Update docs to reflect manual setup

Fixes: angular-fullstack#1966, angular-fullstack#1950
Awk34 pushed a commit that referenced this issue Oct 19, 2016
* docs (generators): Heroku generator run manually

Remove 'yo angular-fullstack:heroku' (not working)
Update docs to reflect manual setup

Fixes: #1966, #1950. [skip ci]
@adyngom
Copy link

adyngom commented Nov 3, 2016

@flaurian steps should definitely be merged into Heroku readme. The confusing part is that you need to step out of dist and run the two last commands inside of root:

cd ..
grunt build
grunt buildcontrol:heroku

@tslmy
Copy link

tslmy commented Oct 14, 2017

how about using gulp build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants