angular2 universal is very unstable - [nodemon] app crashed - waiting for file changes before starting

393 Views Asked by At

I am finding the starter repo from angular class very very unstable or just on how I am using it. My code works locally hitting the same service as remote yet I get the below

I followed the rules

npm run build
npm start

The slightest error I get the below:

'Hash: 51619e5be8128fe9ed97eb75ce5c5bacf4f02ce1
Version: webpack 2.1.0-beta.22
Child
    Hash: 51619e5be8128fe9ed97
    Version: webpack 2.1.0-beta.22
    Time: 18736ms
       Asset     Size  Chunks             Chunk Names
    index.js  3.57 MB       0  [emitted]  main
     [320] ./src async 160 bytes {0} [built]
        + 544 hidden modules
Child
    Hash: eb75ce5c5bacf4f02ce1
    Version: webpack 2.1.0-beta.22
    Time: 11670ms
       Asset     Size  Chunks             Chunk Names
    index.js  33.5 kB       0  [emitted]  main
        + 28 hidden modules

> [email protected] start /var/test-starter
> npm run server


> [email protected] server /var/test-starter
> nodemon dist/server/index.js

[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /var/test-starter/dist/**/* src/index.html
[nodemon] starting `node dist/server/index.js`
Listening on: http://localhost:3000
EXCEPTION: Response with status: 200 Ok for URL: null

/var/test-starter/node_modules/zone.js/dist/zone-node.js:140
                        throw error;
                        ^
Response with status: 200 Ok for URL: null
[nodemon] app crashed - waiting for file changes before starting...

How can this crash a server? I have to kill and restart.

I use angular2 n production without issue. angular2 universal is rather problematic.

How do I resolve gracefully? Or am I not serving in production properly?

1

There are 1 best solutions below

0
Hongbo Miao On

The issue seems related with angular/zone.js based on your error.

Try to back to [email protected]. If it works, try to locate the codes which cause the issue and reproduce it and post at here.

Since [email protected], there are some new issues, such as https://github.com/angular/zone.js/issues/448