Skip to content
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

TypeError: Cannot read property 'emit' of undefined after upgrade to 2.0.0 @ionic/cli-plugin-ionic1 #2437

Closed
dufroLabs opened this issue Jun 14, 2017 · 5 comments

Comments

@dufroLabs
Copy link

dufroLabs commented Jun 14, 2017

After I upgraded my project to @ionic/cli-plugin-ionic1 2.0.0 (latest), I am facing with following issue:

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

But this is also happening for a new baseline project

Steps to reproduce

  1. ionic start newIonicV1 sidemenu --type=ionic1
  2. ionic serve -b --address localhost

Also, when I reverted back to @1.3.0 my live reload stop working.

global packages:

@ionic/cli-utils : 1.2.0
Ionic CLI        : 3.2.0

local packages:

@ionic/cli-plugin-ionic1 : 2.0.0
Ionic Framework          : ionic1 1.3.3

System:

Node       : v6.10.3
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b 
ios-deploy : not installed
ios-sim    : not installed
@janpio
Copy link
Contributor

janpio commented Jun 15, 2017

Can you run the same command with --verbose please?

@dufroLabs
Copy link
Author

@janpio Sure. as requested.

ionic serve -b --address localhost --verbose
[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Load local plugin @ionic/cli-plugin-ionic1
[DEBUG] Load local plugin @ionic/cli-plugin-proxy
[DEBUG] Getting plugin info for ionic
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic1
[DEBUG] Getting plugin info for @ionic/cli-plugin-proxy
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic1@latest.
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-proxy@latest.
[DEBUG] Latest version of ionic@latest is 3.4.0.
[DEBUG] Latest version of @ionic/cli-plugin-proxy@latest is 1.3.1.
[DEBUG] Latest version of @ionic/cli-plugin-ionic1@latest is 2.0.0.
[INFO] The Ionic CLI has an update available (3.2.0 => 3.4.0)!

[WARN] No write permissions for global node_modules--automatic CLI updates are disabled.
To fix, see https://docs.npmjs.com/getting-started/fixing-npm-permissions

   Or, install the CLI update manually (you will likely need sudo):
   
   npm install -g ionic@latest

[INFO] Starting server: --nobrowser --b --address=localhost --log-level=debug --port=8100 --p=8100 --livereload-port=35729 --r=35729 - Ctrl+C to cancel
[DEBUG] Watch patterns: www//*, !www/lib//, !www/**/.map
[DEBUG] !!! ERROR ENCOUNTERED !!!
TypeError: Cannot read property 'emit' of undefined
[DEBUG] TypeError: Cannot read property 'emit' of undefined
at /Users/uditjain/_projects/newIonicV1/node_modules/@ionic/cli-plugin-ionic1/dist/serve/index.js:99:19
at next (native)
at fulfilled (/Users/uditjain/_projects/newIonicV1/node_modules/@ionic/cli-plugin-ionic1/dist/serve/index.js:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)

@dufroLabs
Copy link
Author

@janpio After I have updated to ionic CLI to 3.4 this is resolved.

global packages:

@ionic/cli-plugin-proxy : 1.3.1
@ionic/cli-utils        : 1.4.0
Gulp CLI                : not installed globally
Ionic CLI               : 3.4.0

local packages:

@ionic/cli-plugin-gulp   : 1.0.1
@ionic/cli-plugin-ionic1 : 2.0.0
Ionic Framework          : ionic1 1.3.3

System:

Node       : v6.10.3
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b 
ios-deploy : not installed
ios-sim    : not installed
npm        : 3.10.10 

@dufroLabs
Copy link
Author

@janpio there is still one issue. My initial project does not reload the browser, whereas the baseline project does. I have checked package.json and everything seems to be same.

Can you help to shed some light on this?

@dufroLabs dufroLabs reopened this Jun 15, 2017
@janpio
Copy link
Contributor

janpio commented Jun 15, 2017

That sounds more like an issue for the forum at https://forum.ionicframework.com/, not the issues of the CLI.

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

No branches or pull requests

2 participants