Angular-cli: ng serve doesn't work on cloud9

Created on 22 Feb 2017  路  10Comments  路  Source: angular/angular-cli

It says "NG Live Development Server is running on http://localhost:8080" but when i preview the running application nothing shows up. Everything seems fine but i can't view my application.

This might be helpful

As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.

To disable this warning use "ng set --global warnings.packageDeprecation=false".

fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
* NG Live Development Server is running on http://localhost:8080. *
10% building modules 4/5 modules 1 active ...lient/index.js?http://localhost:8080/(node:3971) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
Hash: e9d72df9bc21522a0b9f
Time: 75724ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 228 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.map (main) 3.97 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.62 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.

Most helpful comment

For anyone finding this from Google, I just tried this and you need to change --public to --public-host

All 10 comments

You should probably set the host parameter to listen on all interfaces: --host 0.0.0.0

I found developeralex's recommendation to set up angular2 cli in cloud9 to be effective.

https://community.c9.io/t/anyone-using-c9-to-do-the-angular2-project/7078/12

thanks. It worked

mine works with
ng serve --host $IP --port $PORT --public $C9_HOSTNAME

ng serve --host $IP --port $PORT --public $C9_HOSTNAME

Also worked for me

modify : package.json

change like this :

{
"name": "ng-template",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --host $IP --port $PORT --public $C9_HOSTNAME",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},

it work for me

For anyone finding this from Google, I just tried this and you need to change --public to --public-host

This was what worked for me.
// package.json
{
"name": "hello",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --host $IP --port $PORT --public-host --disable-host-check",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},

Combining everything that have been said, replace "start": "ng serve" by "start": "ng serve --host $IP --port $PORT --public-host $C9_HOSTNAME" from package.json

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings