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.dir works the same as log #875

Closed
tsonevn opened this issue Feb 6, 2018 · 17 comments
Closed

console.dir works the same as log #875

tsonevn opened this issue Feb 6, 2018 · 17 comments
Milestone

Comments

@tsonevn
Copy link

tsonevn commented Feb 6, 2018

From @NickIliev on November 13, 2017 11:34

From @NickIliev on October 30, 2017 7:41

From @Andy-ZYA on October 28, 2017 8:48

I am following the official tutorial and after I change console.log to console.dir, the terminal shows the same thing.

CONSOLE LOG file:///app/app.component.js:6:20: [object Object] CONSOLE LOG file:///app/tns_modules/@angular/core/./bundles/core.umd.js:2957:20: Angu

How should I fix this problem?

Copied from original issue: NativeScript/NativeScript#4997

Copied from original issue: NativeScript/nativescript-cli#3186

Copied from original issue: NativeScript/NativeScript#5064

@tsonevn
Copy link
Author

tsonevn commented Feb 6, 2018

From @NickIliev on November 13, 2017 11:34

Hey @Andy-ZYA thank you for reporting this issue - confirming this one as a bug.

Steps to reproduce - use this test app and see how console.dir works at this line

@tsonevn
Copy link
Author

tsonevn commented Feb 6, 2018

From @NickIliev on November 13, 2017 11:34

From @blueberrynotblue on October 30, 2017 8:25

@NickIliev btw,is tns 3.3.0 not available now? npm install and update not work for 3.3.0

@tsonevn
Copy link
Author

tsonevn commented Feb 6, 2018

From @NickIliev on November 13, 2017 11:34

@blueberrynotblue it is available on NPM.

npm i -g nativescript@latest

@tsonevn
Copy link
Author

tsonevn commented Feb 6, 2018

From @NickIliev on December 5, 2017 15:42

Issue is still reproducible on ioS with release and master branches (3.3.0 and next) for tns-ios and tns-core-modules.

Steps to reproduce:

On iOS console.dir prints

CONSOLE LOG file:///app/main-view-model.js:12:20: [object Object]

on Android the same command dumps the properties as expected

@Christopotamus
Copy link

Is there an ETA on this bug? I can confirm this still happens to me on 3.4.1 ios only.

@ginev
Copy link
Contributor

ginev commented Feb 16, 2018

@Christopotamus - we will make sure to align the behaviour of console.dirbetween NS Android and NS iOS in the next major release. In the meantime, note that when you run your app by using tns debug ios you will still get the first-level properties of the provided object.

@Neutrino-Sunset
Copy link

Neutrino-Sunset commented Apr 1, 2018

I get this bug too with Android on Mint 18.3

nativescript 3.4.3
tns-core-modules 3.4.1
tns-android 3.4.2
tns-ios Not installed

@Neutrino-Sunset
Copy link

After modifying the app several times and tns run refreshing it, it started working.

@Natalia-Hristova
Copy link
Contributor

Natalia-Hristova commented Apr 2, 2018

@Neutrino-Sunset ,
this issue is for ios and you said that you don't have it installed, so what's your specific steps to reproduce it?

Have in mind that this fix will be available in the next official release of nativescript and tns-ios - 4.0.0 (coming next week) or you can try it out right now with the rc versions of nativescript and tns-ios .
Please, let us know if you still encounter it with the rc version.

@aaayushsingh
Copy link

aaayushsingh commented Apr 10, 2018

@Natalia-Hristova I'm still getting this. I'm using ios simulator on mac

"tns-ios": {
    "version": "4.0.1-rc-2018-04-05-01"
}

CONSOLE LOG file:///app/main-page.js:16:16: [object Object]
CONSOLE LOG file:///app/other-page.js:1:82: other-page's console
CONSOLE LOG file:///app/other-page.js:13:14: [object Object]
CONSOLE LOG file:///app/other-page.js:18:16: [object Object]

@Natalia-Hristova
Copy link
Contributor

@aaayushsingh what's your version of nativescript?

@aaayushsingh
Copy link

@Natalia-Hristova it's 3.4.3

@Natalia-Hristova
Copy link
Contributor

@aaayushsingh the issue is also related with nativescript so you should update nativescript to rc.
You can do it like this:

npm cache clean -f
npm uni -g nativescript
npm i -g nativescript@rc

Then remove ios platform and add it's rc version.
Thanks for your comment! I'll add this in the comment for the fix.

Please let me know if you still face the same issue after the update.

@aaayushsingh
Copy link

@Natalia-Hristova Works now, thanks!

There is no indenting though, everything is to the very left of the terminal. It's hard to find things, is it going to change before the release?

@Natalia-Hristova
Copy link
Contributor

@aaayushsingh Happy to hear that! =)

Actually, this is expected. It's shown the same way as it is in android-runtime.
Btw the new versions of nativescript and runtimes are already released. Currently, there's no plans for change this but feel free to open a new improvement issue with your suggestion or if you have any other problems, ideas etc.

@aaayushsingh
Copy link

aaayushsingh commented Apr 11, 2018

@Natalia-Hristova I was talking about this behaviour highlighted in this image.

screen shot 2018-04-11 at 2 03 34 pm

I can work on it and possibly submit a PR, just guide me to the part where I look for it and start working.

@Natalia-Hristova
Copy link
Contributor

Ohh , now I understand. You're right - definitely can be better

I can work on it and possibly submit a PR, just guide me to the part where I look for it and start working.

Great! It would be super awesome!

First, you can start with environment setup -> README.md after that you can check the guidelines to follow when contributing - CLA signing, branch management, etc and also read how to connect the local iOS runtime project to a custom {N} project for easier debugging

You can look at this code to implement the fix you suggest.

Hope this will help you to start and soon you will became a part of the the {N} contributors family :)

If you have any questions or face any problems related to the setup or not, feel free to open a new issue so it would be easier to find it and to be resolved (instead of writing here in this issue).

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

No branches or pull requests

7 participants