Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18616] iOS Debugger: Breakpoints not recognized on files that are required()

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2015-12-03T03:34:43.000+0000
Affected Version/sRelease 3.5.1
Fix Version/sn/a
ComponentsiOS
Labelsdebugger, ios, qe-3.5.1
ReporterEric Wieber
AssigneePedro Enrique
Created2015-02-25T20:08:39.000+0000
Updated2017-03-31T22:32:20.000+0000

Description

*Steps to reproduce issue*: 1. Create a new application 2. Replace the content of app.js with the following:
var win = Ti.UI.createWindow({ 
backgroundColor:'#fff' 
}); 

var lib = require('lib'); 

var container = Ti.UI.createScrollView({ 
top:50, 
left:10, 
right:10, 
height:150, 
width:300, 
contentWidth:800, 
scrollType:'horizontal' 
}); 

container.addEventListener('scroll', lib.eventHandler); 

container.add(Ti.UI.createLabel({width:800, height: 20, 
text:'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor'})); 

win.add(container); 
win.open();
3. Create a lib.js file in the "Resources" folder of the project with the following code:
exports.eventHandler = function() { 
    Ti.API.info('got scroll'); 
}
4. Add a breakpoint to line 2 of lib.js 5. Debug the application. 6. Scroll the text box. *Expected Result*: The breakpoint is hit on scroll. *Actual Result*: Breakpoint is not hit *Notes*: This is not a regression as the same is seen with 3.5.0.GA.

Comments

  1. Chee Kiat Ng 2015-11-25

    Hi, I just tried to reproduce and the breakpoint is hit as expected. This is my environment: Ti SDK 5.1.0.GA Studio 4.4.0 IOS 9.1 / Xcode 7.1 Node.js Node.js Version = 4.2.2 npm Version = 2.14.7 Appcelerator CLI Installer = 4.2.2 Core Package = 5.1.0 Titanium CLI CLI Version = 5.0.5 node-appc Version = 0.2.31
  2. Ben Bahrenburg 2015-11-26

    Hi Kiat, I'm noticing this works in Classic but not in Alloy.
  3. michael warnes 2015-11-27

    This is also *not* working for me. Are you sure your version of node is correct? Also are you testing on windows or mac? I have tested it in an alloy project. Could I possibly politely ask that you address this? Could I ask why you have pushed this back into a later release? This feature has been broken since 3.4.1 and is a key feature....would you agree that being able to debug is a key developer capability. My app has 20-30 required files, and I've posted several request regarding this over a number of months, I guess I must be the only one that is being affected by this? NB I can debug into the code if I set a breakpoint on the call into the required module, but breakpoints in the module are being ignored. Ti SDK 5.1.0.GA Studio 4.4.0 IOS 9.1 / Xcode 7.1 Node.js Node.js Version = 0.12.7 npm Version = 2.11.3 Appcelerator CLI Installer = 4.1.3 Core Package = 5.1.0 Titanium CLI CLI Version = 5.0.5 node-appc Version = 0.2.26 Operating System Name = Mac OS X Version = 10.11.1 Architecture = 64bit # CPUs = 4 Memory = 16.0GB Node.js Node.js Version = 0.12.7 npm Version = 2.11.3 Titanium CLI CLI Version = 4.1.3 node-appc Version = 0.2.26
  4. michael warnes 2015-11-27

    also this was working in 3.4.1GA so it should be marked as a regression
  5. Chee Kiat Ng 2015-11-27

    [~mike@warnes.com] This ticket was specific to Classic projects, hence we addressed it as it is, and waited for feedback like yours before closing the ticket. And we appreciate you and Ben for informing us that this doesn't work on Alloy projects so we will continue looking into it. The release version is not final as our planning is progressive Please don't take it as us putting less priority into it.
  6. michael warnes 2015-11-27

    understood, and I appreciate you taking the time to look into this. Could you advise if this should be closed and a new ticket opened specific to Alloy then. I am very keen to get this addressed if possible, and would be very glad to help. My project has a large number of javascript modules as a result of the recommended approach to adding functionality to Alloy controllers...i.e. using stateful modules. Thank you for the feedback
  7. Chee Kiat Ng 2015-11-27

    This will not be closed. And i'll make a reproducible alloy sample app and update this ticket accordingly.
  8. michael warnes 2015-11-27

    Excellent, thank you very much!! honestly this has been making life so difficult!!!. As a work around, I guess I could try to include my modular code in the controllers where debugging is essential, but it is good to know finally that it is not something that is being caused by my code. Although I'd reached that conclusion as I had tried every possible configuration of modularising the code.
  9. Chee Kiat Ng 2015-11-27

    These are really good information you have provided, it will be helpful. Appreciate it!
  10. Chee Kiat Ng 2015-12-01

    [~mike@warnes.com] [~ben.bahrenburg@gmail.com], Thanks to [~fmiao] investigation, here is what we found out: Alloy doesn't support breakpoints in commonjs modules, it's [stated here](http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Debugging_and_Troubleshooting): bq. Breakpoints set in the CommonJS modules and Alloy Model files in the app directory are ignored during debugging. To add breakpoints for these items, you need to add the breakpoints to the generated Titanium files created by the Alloy CLI. The CommonJS modules are copied to the Resources directory and the generated Alloy Model files are located in the Resources/alloy/models directory. So we can open an ALLOY ticket for a feature request on this, but at the moment, here is a work around. 1. In Appcelerator Studio, go to Window in the menu -> Show View -> App Explorer 2. In App Explorer, Choose your project. On the right top corner, click on the chevron icon, and -> customize view 3. Uncheck 'Appcelerator Resources Folders' 4. Build your project. Find the relevant required file in the Resources Folder (that was generated by Alloy) and add your breakpoints. If there's no other concerns, we will resolve this ticket as fixed (for classic project) and create a new ALLOY feature ticket to enable breakpoints on required() files.
  11. michael warnes 2015-12-01

    yes, by coincidence I saw this yesterday, and was going to update the ticket, so my apologies. I have retested this and can confirm it works correctly. However there are many points in my application, when using the simulator, in debug that the application simple stops completely with no warning. It is very difficult for me to diagnose exactly what it is happening, but it appears that putting breakpoints in certain areas of code cause catastrophic failure in the debugger. Are you aware of this kind behaviour with Alloy applications? At the moment I have had to add multiple alerts to my code to see what is happening...it is very laborious. I will try and create a test project to reproduce the behaviour
  12. Chee Kiat Ng 2015-12-01

    There is a few issues with debugger on alloy and we have tickets for them. Our team is actually running through all of them now. But if there's any case you can reproduce we definitely welcome it.
  13. michael warnes 2015-12-01

    Great, very much appreciated, many thanks
  14. Chee Kiat Ng 2015-12-03

    Marking as cannot reproduce since this was specific to titanium classic projects and it's not reproducible there. Later discussions are for a separate feature on Alloy.
  15. Emily Feder 2015-12-07

  16. Chee Kiat Ng 2015-12-08

  17. Lee Morris 2017-03-31

    Unable to reproduce this issue, tested with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80 Please file a new ticket if this problem still persists.

JSON Source