Monaca IDE - console.log never appears



  • Odd question, but only once while using Monaca IDE has anything ever shown up in the console.log portion of the IDE itself. It only occurred when I had a device synced via the debugger. I have since tried syncing it and I never get the device to show in the drop down box, it usually says unknown device /www/html/…

    Now, do know that I have put several console.log(‘test’); lines of code to try this out and still no success. I would think that the IDE’s console area would show the log operations from the emulator and not from the device debugger as it has its own log that is view-able on the device, but this apparently isn’t the case. Is this correct or am I just really missing something simple here?



  • Why don’t you consider using chrome dev tools? I think it is a lot better for debug your application.


  • Monaca

    @munsterlander that’s the actual desired behavior. Monaca debug tool will work only from Monaca Debugger, as we supposed developers will use the browser’s integrated debug tools.

    @rafitaangkor is right, chrome dev tools offers a very good debugger.



  • Thank you for the responses. I absolutely do use Chrome dev tools which was kind of the basis for my question. If that is the desired purpose, then why even replicate the Elements, Resources, Network, Timeline, Console tabs in the IDE as there is the console in the device debugger app? Furthermore, even when it is connected to the device, I can’t get anything to appear there which is why I ask, how do we make stuff appear there? If nothing is supposed to appear there, then why build it into the cloud IDE and is there a way to hide it completely as screen space is limited?

    Thanks again guys!


  • Monaca

    You should consider that more devices can be debugged at the same time. The debugging tools in Monaca are more powerful than the ones integrated into the Debugger.
    It’s not normal that you can’t make stuff appear there, it should display the instructions (like console.log) automatically, without any setup. Can you please tell me which version of the debugger are you using and which os+version?
    Thanks



  • @Andi Thanks! I hadn’t really thought about debugging on multiple devices, as it is just me developing here, but that makes total sense. After I closed the tab that had the IDE in and went back to it, the log is working. Previously, even when I clicked the Run on Device button in the IDE, it would just add a new line in the select box down by the console with another, Unknown Device: /www/html/…

    After the restart and clicking it, I get my device model number in the list and the console works. I guess there was some timeout issue or whatever. Anyway, to help troubleshoot that, here is the info requested:

    Monaca Debugger: 5.0.3
    Cordova Version 5.2.0
    Cordova-Android Version 4.1.1

    Device info:
    Samsung Galaxy S6
    Android Version 5.1.1


  • Monaca

    @munsterlander thank you! Please let us know if this issue affects you again in the future :)



  • @Andi So this isn’t that big of an issue, but I figured out the problem. When it happens next, I will try to remember and grab a screenshot so you can pass it on to the IDE team. Basically, I keep the Monaca IDE tab open in Chrome all the time (I work via my laptop remotely). When I come back after a long absence (several hours, I don’t know what the time out is), the bottom section in the console has the Chrome error showing, like that page timed out. The IDE is still there, just that section is greyed out.

    So to fix this, I would just refresh the page. The section pops back and all is good EXCEPT I just figured out that at that moment is when the device connection no longer works. I can still click Run on Device and it works - syncing with the device - but the console.log no longer shows up. In order to get that back and working, you have to close the tab and reopen it; then everything works.

    Now, I know this is a super small issue and by no means would I want you guys wasting time on it when I think 2.0 and beyond is FAR more important (Absolutely LOVE what you guys are doing and have been promoting you to some of my buddies at other companies), but it would be good if there was a way to re-enable those connections or force a whole IDE timeout that would then solve it. Just a small thing that threw me for a bit.

    Thanks again!!


  • Monaca

    @munsterlander Thank you very much for the detailed explanation! We will take a look at this when we will have some free time and eventually try to fix the issue :)


Log in to reply