angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Deploy to Heroku not working #1339

Open prateekagr98 opened 9 years ago

prateekagr98 commented 9 years ago

When trying to deploy to Heroku using the mentioned commands the deployment is done but the application always gives a 503 error for any route

Awk34 commented 9 years ago

Any more details? I don't think that's an issue with the generator, probably with Heroku or your setup

DDunc commented 9 years ago

As of right now the fullstack demo example returns the heroku application error page for index, and a 503 error for favorite icon. Is the generator currently broken?

kawashimaken commented 8 years ago

+1

bsimondet commented 8 years ago

Below is an excerpt from the logs I got when I tried to deploy to heroku. Is this the same issue? If so, has anyone found a solution?

2016-02-21T07:55:55.059490+00:00 app[web.1]: /app/server/app.js:7 2016-02-21T07:55:55.059494+00:00 app[web.1]: import express from 'express'; 2016-02-21T07:55:55.059495+00:00 app[web.1]: ^^^^^^ 2016-02-21T07:55:55.059496+00:00 app[web.1]: 2016-02-21T07:55:55.059497+00:00 app[web.1]: SyntaxError: Unexpected reserved word 2016-02-21T07:55:55.059498+00:00 app[web.1]: at exports.runInThisContext (vm.js:53:16) 2016-02-21T07:55:55.059498+00:00 app[web.1]: at Module._compile (module.js:373:25) 2016-02-21T07:55:55.059499+00:00 app[web.1]: at Object.Module._extensions..js (module.js:416:10) 2016-02-21T07:55:55.059500+00:00 app[web.1]: at Module.load (module.js:343:32) 2016-02-21T07:55:55.059501+00:00 app[web.1]: at Module.require (module.js:353:17) 2016-02-21T07:55:55.059502+00:00 app[web.1]: at require (internal/module.js:12:17) 2016-02-21T07:55:55.059502+00:00 app[web.1]: at Object. (/app/server/index.js:12:28) 2016-02-21T07:55:55.059500+00:00 app[web.1]: at Function.Module._load (module.js:300:12) 2016-02-21T07:55:55.059503+00:00 app[web.1]: at Module._compile (module.js:409:26) 2016-02-21T07:55:55.069223+00:00 app[web.1]: 2016-02-21T07:55:55.059504+00:00 app[web.1]: at Object.Module._extensions..js (module.js:416:10) Process exited with status 1 State changed from starting to crashed

tu-lil commented 8 years ago

I have the same issue. I deploy to heroku and get message from heroku that build and deployment are success. However, when I try to access my app I get HTTP 503 error code. I get this response for any page/route I try to visit. The app works fine on my local machine though.

Originally I thought maybe I have modified some settings/config files . So, I tried to install the basic angular-fullstack app on my machine and deploy it without any changes from my side. And the result is exactly the same - error 503.

elmeerr commented 8 years ago

I can't even deploy my app using heroku as the docs says. in the end I got this message

Adding files for initial commit
× { [Error: stderr maxBuffer exceeded] cmd: 'git add -A && git commit -m "Initial commit"' }

Uploading your initial application code.
 This may take several minutes depending on your connection speed...
× { [Error: Command failed: git push -f heroku master
error: src refspec master does not match any.
error: failed to push some refs to 'https://git.heroku.com/meek.git'
]
  killed: false,
  code: 1,
  signal: null,
  cmd: 'git push -f heroku master' }
identical dist\Procfile

@liliya0artyuh try replace all import xxxx from yyyy for var xxxxx = require('yyy')

to see if it works...I think heroku doesn't support new ECMAScript syntax.

IkramShah65 commented 7 years ago

@Awk34 Can you please let us know if you're able to replicate this issue on your end I published my angular Full stack application on Heroku and facing same issue. Please guide if we're doing anything wrong.

Here is my directory URL

https://github.com/IkramShah65/mean-tutorial

Similar issue has been reported here as well

https://github.com/angular-fullstack/generator-angular-fullstack/issues/2103

Detailed file is also attached.

Kindly review.

Heroku_Log.txt

Thanks.

Awk34 commented 7 years ago

@IkramShah65 you need to gulp build your project, and then NODE_ENV=production node ./dist/server

IkramShah65 commented 7 years ago

Thanks Alot @Awk34 it worked:)

Those having same issue can use solution recommended by @Awk34 for further details followings links would be helpful

https://angular-fullstack.github.io/examples/Heroku_Deployment/

https://angular-fullstack.github.io/generators/heroku/

Happy coding 👍

kamalkech commented 7 years ago

@IkramShah65 your links not working oooff

Awk34 commented 7 years ago

@kamalkech fixed

kamalkech commented 7 years ago

@Awk34 can u send links to check how impliment that ?

Awk34 commented 7 years ago

https://angular-fullstack.github.io/examples/Heroku_Deployment/

https://angular-fullstack.github.io/generators/heroku/

kamalkech commented 7 years ago

@Awk34 thank you for this links, "grunt build" = "ng build--prod" ??