Ionic-app-scripts: Ionic serve error: Cannot read property 'message' of undefined

Created on 12 May 2017  路  8Comments  路  Source: ionic-team/ionic-app-scripts

I can run 'ionic serve' normally and app was compiled successfully, but after few seconds later the server suddenly stop running and produce an error as following:

TypeError: Cannot read property 'message' of undefined
at Server.error (D:\IONIC_PROJECT\vkirirom\node_modules\tiny-lr\src\server.js:266:52)
at Socket. (D:\IONIC_PROJECT\vkirirom\node_modules\tiny-lr\src\server.js:217:22)
at emitOne (events.js:101:20)
at Socket.emit (events.js:188:7)
at onwriteError (_stream_writable.js:343:10)
at onwrite (_stream_writable.js:361:5)
at WritableState.onwrite (_stream_writable.js:90:5)
at fireErrorCallbacks (net.js:467:13)
at Socket._destroy (net.js:508:3)
at Socket._writeGeneric (net.js:711:17)

And here is my ionic info:

global packages:
@ionic/cli-utils : 1.0.0
Cordova CLI : 7.0.0
Ionic CLI : 3.0.0
local packages:
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework : ionic-angular 3.2.0
System:
Node : v6.10.3
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed

Does anyone has any ideas about this issue ?

needs_reply

All 8 comments

Hello, could you post a repo we could use to reproduce this issue, please? Thanks!

Hi @jgw96 , Thank you so much for your kind reply and sorry for late, But it seems like my issue is already fixed by upgrading to the latest version.
Here is my ionic info:

global packages:
@ionic/cli-utils : 1.1.2
Cordova CLI : 7.0.0
Ionic CLI : 3.1.2
local packages:
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.1.2
@ionic/cli-plugin-ionic-angular : 1.1.2
Ionic Framework : ionic-angular 3.2.0
System:
Node : v6.10.3
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed

I am still facing the issue. Any idea how to solve it ?

I used to run ionic serve properly earlier. For some reason I re-installed OS (Win 10). After that it is giving me this error every single time with the existing project as well as new ones.

PS: I know its not OS related issue + I have even later versions of libraries.

I am still facing the same issue. Any updates?

Can you update to app-scripts 1.3.8 and try it again?

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

I'm facing this trouble now and I don't know how to procede. Does anyone know how to correct this?

I done goofed, y'all.

I am currently working on some legacy~ application code built with Ionic Framework V1 (1.1.0 if my original 'bower.json' file is to be trusted).

I had a newer version of Ionic installed globally on my machine, 3.2.0 the last time I checked, the only update I made to the file structure was changing the "ionic.project" file in root to "ionic.config.json" as was suggested by a Stack Overflow solution to a cross-compatibility issue.

Earlier today I was prompted to update my CLI from 3.2.0 to 4.0 and I figured "If this Ionic V1 code is working with V3.2.0, why not 4.0?", on the assumption that the major changes in the Ionic framework happened between V1 and V2, with the switch from AngularJS to Angular framework....now I am unable to run something as simple as "ionic serve" even after reverting to several older versions of the Ionic / Ionic CLI installation (I tried 3.2.0, 1.1.0 and 1.1.2, in that order).

I am currently running 3.2.0 and when I try running "ionic serve" in this current environment this is returned:

[INFO] Starting server: --port=8100 --p=8100 --livereload-port=35729 --r=35729 --address=0.0.0.0 - Ctrl+C to cancel
TypeError: Cannot read property 'emit' of undefined

I have already reinstalled cordova, cordova android, and uninstalled ionic framework and reinstalled, with no luck. Any help would be greatly appreciated! 馃挴 鉂わ笍

Was this page helpful?
0 / 5 - 0 ratings