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

console output doesn't work for Ionic v1 / CLI 3.5 #2548

Closed
jasonwinshell-br opened this issue Jul 21, 2017 · 17 comments
Closed

console output doesn't work for Ionic v1 / CLI 3.5 #2548

jasonwinshell-br opened this issue Jul 21, 2017 · 17 comments
Labels
Milestone

Comments

@jasonwinshell-br
Copy link

Description:

--console option (for any command that supports it) does not work with Ionic v1 + CLI 3.

ionic serve -c
[INFO] Starting server: --consolelogs --c --port=8100 --p=8100 --livereload-port=35729 --r=35729 --address=0.0.0.0 -
Ctrl+C to cancel

Steps to Reproduce:

Use a Ionic v1 project + CLI 3.5. Can be produced using a template project such as tabs. Just add a console.log ("MESSAGE TO CONSOLE") in any .js, e.g. app.js

  1. ionic serve -c
  2. console does not get echoed to Terminal window, only to browser's native console logger in debugger

Output:

ionic serve -c
[INFO] Starting server: --consolelogs --c --port=8100 --p=8100 --livereload-port=35729 --r=35729 --address=0.0.0.0 -
Ctrl+C to cancel

NO OUTPUT to terminal. Only to Safari / Chrome debugger console.

OR to an emulator

ionic cordova emulate -lc ios --target 'iPad-Air-2'

[INFO] Starting server: --livereload --l --consolelogs --c --address=0.0.0.0 --port=8100 --p=8100
--livereload-port=35729 --r=35729 --iscordovaserve --external-ip-required --nobrowser - Ctrl+C to cancel

NO OUTPUT to terminal. Only to Safari debugger console.

My ionic info:

global packages:

@ionic/cli-plugin-proxy : 1.3.2
@ionic/cli-plugin-proxy : 1.3.2
@ionic/cli-utils        : 1.5.0
Cordova CLI             : 7.0.1 
Gulp CLI                : not installed globally
Ionic CLI               : 3.5.0

local packages:

@ionic/cli-plugin-cordova : 1.4.1
@ionic/cli-plugin-gulp    : 1.0.2
@ionic/cli-plugin-ionic1  : 2.0.1
Cordova Platforms         : android 6.0.0 ios 4.4.0
Ionic Framework           : ionic1 1.3.3

System:

Node       : v7.4.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b 
ios-deploy : 1.9.0 
ios-sim    : 5.0.13 
npm        : 4.1.1 
@imhoffd imhoffd added the bug label Jul 21, 2017
@imhoffd imhoffd added this to the CLI Future milestone Jul 21, 2017
@lucarin91
Copy link

There is some work around to show the console log when running the android emulator?

@imhoffd
Copy link
Contributor

imhoffd commented Jul 25, 2017

@lucarin91 For now if you open chrome://inspect in your Chrome browser, you can attach to your device debugger.

@mateosss
Copy link

I can confirm that consolelogs are still not working on CLI 3.6.0 for v1 projects (but livereload is now, thanks for that!)

@Mimateam
Copy link

Mimateam commented Aug 1, 2017

I can also confirm that consolelogs are not working on ionic CLI 3.6.0 for v1 projects (all plugins updated). Livereload now works fine. Just for info: on previous versions of ionic CLI livereload works if you run your app with --address and --port option. For example: ionic cordova run android -l --address <IP> --port <port>

@raghavendradabbir
Copy link

I also found this for CLI 3.7.0 - need help on this urgently.

@mateosss
Copy link

mateosss commented Aug 9, 2017

@raghavendradabbir as a workaround you can see prints from your app in other ways.

  • using the native log tool: In Android it would be adb logcat | grep chromium in a Linux terminal, or on Mac using xcode will show you the output. If you use this method be sure to, when you log objects and arrays, before transform them to a string with JSON.stringify() javascript method. You won't be able to log nested objects tho.

  • using Chrome developer tools (recommended). Connect your device to the pc with all the debug settings properly configured, and open chrome > Dec tools (f12) > options > more tools > remote devices > your device should appear in the left panel and when you open your app you will see a new "tab" in the right, choose inspect, and now you have all chrome tooling for debugging your app, even with access to the native plugin, and you can control your phone screen within Chrome.

@lucbonnin
Copy link

Hi all. i've the same issue. ionic 1, CLI 3.7, no more console logs... :(
I can build, compile, run app under ionic serve but no debug console output which is really blocking.

@raghavendradabbir
Copy link

@mateosss - Thanks for the response. I was more keen on knowing if there is a plan to release the fix for this shortly.

@lucbonnin
Copy link

still not working for me with CLI 3.8

@lucbonnin
Copy link

ionic info :


    @ionic/cli-utils  : 1.8.1
    ionic (Ionic CLI) : 3.8.1

global packages:

    Cordova CLI : not installed

local packages:

    Cordova Platforms : none
    Ionic Framework   : ionic1 1.3.1

System:

    Android SDK Tools : 25.2.4
    ios-deploy        : 1.9.0 
    ios-sim           : 5.0.8 
    Node              : v6.11.2
    npm               : 5.3.0 
    OS                : macOS Sierra
    Xcode             : Xcode 8.0 Build version 8A218a 

@imhoffd imhoffd modified the milestones: 3.9.0, 3.10.0 Aug 16, 2017
@imhoffd
Copy link
Contributor

imhoffd commented Aug 16, 2017

Yep, I'm aware. I keep pushing back the milestone, my apologies. I am trying for 3.10.0 release.

@janynnegomes
Copy link

The same here, not working the console logs 👎

Console Info:

cli packages: (/usr/lib/node_modules)

    @ionic/cli-utils  : 1.9.0
    ionic (Ionic CLI) : 3.9.0

global packages:

    Cordova CLI : 7.0.1 

local packages:

    Cordova Platforms : android 6.1.2
    Ionic Framework   : ionic1 1.3.2

System:

    Android SDK Tools : 25.2.2 rc1
    Node              : v8.4.0
    npm               : 5.3.0 
    OS                : Linux 4.4

@imhoffd
Copy link
Contributor

imhoffd commented Aug 17, 2017

Yep, it's a bug with an assigned milestone. Thanks.

@imhoffd
Copy link
Contributor

imhoffd commented Sep 6, 2017

Apologies for the slow fix, everyone. CLI 3.10.0 will have --consolelogs working for Ionic 1.

@raghavendradabbir
Copy link

Thanks. Works

@omargon
Copy link

omargon commented Nov 1, 2017

I'm still having this issue even though I just upgraded to 3.15.2. I also don't see the --livereload server reload/refresh and/or quit options previously available.

→ ionic info

cli packages: (/Users/{{USER}}/.nvm/versions/node/v6.11.4/lib/node_modules)

    @ionic/cli-utils  : 1.15.2
    ionic (Ionic CLI) : 3.15.2

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    Cordova Platforms : android 6.3.0 ios 4.5.2
    Ionic Framework   : ionic1 1.3.1

System:

    ios-deploy : 1.9.1
    ios-sim    : 6.1.2
    Node       : v6.11.4
    npm        : 3.10.10
    OS         : macOS Sierra
    Xcode      : Xcode 9.1 Build version 9B55

@AlGantori
Copy link

Me too Chrome is not showing console.log output ?
I believe I am on the latest stuff

$ ionic info

cli packages: (C:\Users\AXM\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.6
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 25.2.5
    Node              : v7.2.0
    npm               : 4.0.5
    OS                : Windows 7

Environment Variables:

    ANDROID_HOME : C:/Users/AXM/AppData/Local/Android/android-sdk

Misc:

    backend : pro

my app just started with
ionic start PADAV1 blank
Here is the package.json

{
  "name": "PADAV1",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "5.0.3",
    "@angular/compiler": "5.0.3",
    "@angular/compiler-cli": "5.0.3",
    "@angular/core": "5.0.3",
    "@angular/forms": "5.0.3",
    "@angular/http": "5.0.3",
    "@angular/platform-browser": "5.0.3",
    "@angular/platform-browser-dynamic": "5.0.3",
    "@ionic-native/core": "4.4.0",
    "@ionic-native/splash-screen": "4.4.0",
    "@ionic-native/status-bar": "4.4.0",
    "@ionic/pro": "1.0.16",
    "@ionic/storage": "2.1.3",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "rxjs": "5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.18",
    "moment": "^2.14.1"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.6",
    "typescript": "2.4.2"
  },
  "description": "An Ionic project"
}

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

No branches or pull requests

10 participants