Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25883

"Callback was already called." error thrown when source contains syntax error and transpiling

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 7.1.0, Hyperloop 3.1.0
    • Fix Version/s: Release 7.3.0
    • Component/s: Hyperloop, iOS
    • Environment:

      Hyperloop 3.1.0
      iOS 11
      Example: "HTTP Request"

      Description

      (Only seen on iOS)

      When trying to build our hyperloop-examples sample app, the Callback was already called. error is thrown. It seems to be an issue thrown from the async library we use. There are reports that see this happening when errors are not guarded inside parallel callback flows, so thats where we need to dig into it.

      EDIT:
      Here is a log:

      [DEBUG] Copying and minifying /Users/hknoechel/Documents/Apps/hyperloop-examples/Resources/iphone/alloy/controllers/BaseController.js => /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/BaseController.js
      [TRACE] Checking require for: /alloy
      [TRACE] Checking import for: uikit/uialertcontroller
      [TRACE] Checking import for: uikit/uialertaction
      [TRACE] Checking import for: uikit/uikit
      [TRACE] Checking import for: titanium/tiapp
      [DEBUG] Writing /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/alert.js
      [DEBUG] Copying and minifying /Users/hknoechel/Documents/Apps/hyperloop-examples/Resources/iphone/alloy/controllers/alert.js => /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/alert.js
      [TRACE] Checking require for: /alloy
      [TRACE] Checking import for: uikit/uiview
      [TRACE] Checking import for: uikit/uicolor
      [TRACE] Checking import for: coregraphics/coregraphics
      [DEBUG] Writing /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/animateview.js
      [DEBUG] Copying and minifying /Users/hknoechel/Documents/Apps/hyperloop-examples/Resources/iphone/alloy/controllers/animateview.js => /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/animateview.js
      [TRACE] Checking require for: /alloy
      [TRACE] Checking import for: uikit/uilabel
      [TRACE] Checking import for: uikit/uicolor
      [TRACE] Checking import for: uikit/uiscreen
      [TRACE] Checking import for: uikit/uiview
      [TRACE] Checking import for: uikit/nslayoutconstraint
      [TRACE] Checking import for: uikit/uikit
      [DEBUG] Writing /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/autolayout.js
      [DEBUG] Copying and minifying /Users/hknoechel/Documents/Apps/hyperloop-examples/Resources/iphone/alloy/controllers/autolayout.js => /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/autolayout.js
      [TRACE] Checking require for: /alloy
      [TRACE] Checking import for: corelocation/clbeaconregion
      [TRACE] Checking import for: corelocation/cllocationmanager
      [TRACE] Checking import for: corelocation/corelocation
      [TRACE] Checking import for: uikit/uiapplication
      [TRACE] Checking import for: uikit/uilocalnotification
      [TRACE] Checking import for: foundation/nsuuid
      [TRACE] Checking require for: subclasses/locationmanagerdelegate
      [DEBUG] Writing /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/beacons.js
      [DEBUG] Copying and minifying /Users/hknoechel/Documents/Apps/hyperloop-examples/Resources/iphone/alloy/controllers/beacons.js => /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/beacons.js
      [TRACE] Checking require for: /alloy
      [TRACE] Checking import for: uikit/uiview
      [TRACE] Checking import for: uikit/uicolor
      [TRACE] Checking import for: uikit/uiblureffect
      [TRACE] Checking import for: uikit/uivisualeffectview
      [TRACE] Checking import for: uikit/uikit
      [TRACE] Checking import for: coregraphics/coregraphics
      [DEBUG] Writing /Users/hknoechel/Documents/Apps/hyperloop-examples/build/iphone/build/Products/Debug-iphonesimulator/Hyperloop_Sample.app/alloy/controllers/blur.js
      [ERROR] Callback was already called.
      

      I looks like a race condition between our build-hooks and only seems to happen with the 3.1.0 build from the Hyperloop ES6 PR so far, so it may be related.

      Update! It seems to be caused by a const vs. let issue! I remember the compiler detects that different, so maybe its handled different when being used in Hyperloop code? Maybe we need to return somewhere in order to handle the error in a different layer. Lowing the priority ...

      Example:

      const screenRect = UIScreen.mainScreen.bounds;
      screenRect = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height - 64);
      

        Attachments

          Activity

            People

            • Assignee:
              cwilliams Christopher Williams
              Reporter:
              hknoechel Hans Knöchel
              Reviewer:
              Hans Knöchel
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-6251
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code