Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26876] iOS: Cannot debug a project with hyperloop enabled

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-06-25T20:46:00.000+0000
Affected Version/sn/a
Fix Version/sHyperloop 4.0.3
ComponentsHyperloop, iOS
Labelsn/a
ReporterSatyam Sekhri
AssigneeChristopher Williams
Created2019-03-04T18:15:25.000+0000
Updated2019-06-25T20:46:00.000+0000

Description

Cannot debug a project that has hyperloop enabled. The issue is with debug on iOS only as the debug on same project works fine wth Android Steps to Reproduce: 1. Create a default titanium project with services enabled 2. Add a breakpoint in the js file 3. Debug on iOS simulator or device Actual Result: The breakpoints are not hit during the debug. If we remove hyperloop from the project the same breakpoints are hit successfully. Expected Result: The debug should work even for projects with hyperloop

Comments

  1. Samir Mohammed 2019-03-12

    I took a look at this today and with my testing I was able to use the debugger with Hyperloop enabled in the tiapp.xml. *Test Environment*
       iphone 6 (12.1 Sim)
       Appc Studio: 5.1.2.201903111843
       SDK: 8.0.0.v20190311082612
       Alloy and Titanium applications 
       
  2. Satyam Sekhri 2019-05-20

    Still can see some issues with debug when hyperloop is enabled. There is a distinguished difference in debug behaviour when hyperloop is enabled for the project and when it's removed. Follow the steps below to notice the difference in debug behaviour: 1. Create a new alloy project using the "Default Alloy Project" template and with services enabled. 2. In index.js file, add a breakpoint at line 2 which is _alert($.label.text);_ 3. Now debug on iOS simulator 4. Next from tiapp.xml, remove the hyperloop module for iOS. 5. Again debug on iOS simulator Actual Results: After Step 3: Notice the debug suspends during app launch and the breakpoint we added on line 2 is hit during app launch itself. It was supposed to be hit when we click on the label not on app launch. Click on resume. When app launches click on the "Hello, World" label. No breakpoint is hit. After Step 5: No breakpoint is hit during app launch. The app launches. Click on "Hello, World" label and the breakpoint on line 2 is hit. Note: On Android we see the same behaviour on step 3 and step 5 which is same as what we see on step 5 when debug on iOS. Verified using Studio: 5.2.0.201905172239 and Ti SDK: 8.1.0.v20190520081553
  3. Christopher Williams 2019-06-20

    Note that [~eharris] and [~shaig] also ran into an issue here. It appears that adding hyperloop to the project will result in it injecting additional newlines into the generated code - leading to the breakpoint lines not matching up. The most likely culprit here is hyperloop transforming the code via babel in some way that does not retain the same line numbers. Hopefully the fix is as simple as passing an option to tell babel to retain lines. The more complicated options is to try and merge source maps again like we do in node-titanium-sdk's jsanalyze method.
  4. Christopher Williams 2019-06-20

    Hyperloop is unnecessarily modifying JS files on iOS when nothing should be changing. On Android, it doesn't seem to cause a bug, but it is still doing unnecessary work (re-generating source from the AST) if we don't change the AST (find usage of a hyperloop require/import).
  5. Christopher Williams 2019-06-20

    https://github.com/appcelerator/hyperloop.next/pull/321
  6. Satyam Sekhri 2019-06-25

    FR Passed. Debug of project with Hyperloop works fine on iOS and android.
  7. Satyam Sekhri 2019-06-25

    Verified on: Mac OS 10.14.3 Ti SDK: 8.1.0.v20190619134801 Appc CLI: 7.1.0-master.22 Node: 10.13.0 Alloy: 1.14.0-1 Hyperloop: 4.0.3 JDK: 1.8.0_144 Xcode: 10.2.1

JSON Source