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

Windows: relative require() from sub-directory fails

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 6.0.0
    • Fix Version/s: Release 6.0.0
    • Component/s: Windows
    • Labels:
      None
    • Story Points:
      8
    • Sprint:
      2016 Sprint 13 SDK

      Description

      While writing the mocha test suite, I happened to uncover a bug in Windows require() without actually trying to test it!

      Inside the test app, we have:

      - Resources
      |-- utilities
      |  |-- assertions.js
      |  |-- utilities.js
      |-- app.js
      |-- ti.accelerometer.test.js
      

      /utilities/assertions.js has a require('./utilities'); which is failing to resolve. I believe we're not holding onto the path/dirname of a given module to use as the basis for resolving require calls inside it.

      14:22:31 -- Start application log -----------------------------------------------------
      14:22:31 [ERROR] :  Application Error: {
      14:22:31 [ERROR] :    "line": 2,
      14:22:31 [ERROR] :    "column": 10,
      14:22:31 [ERROR] :    "message": "Error while require(/app) Error while require(./ti.accelerometer.test) Error while require(./utilities/assertions) Could not load module ./utilities",
      14:22:31 [ERROR] :    "native_stack": [
      14:22:31 [ERROR] :      "JSExportClass<class Titanium::GlobalObject>::CallNamedFunction"
      14:22:31 [ERROR] :    ]
      14:22:31 [ERROR] :  }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                cwilliams Christopher Williams
                Reviewer:
                Christopher Williams
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code