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

Creation of Packaged JavaScript and Hybrid Modules: it doesn't work properly

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Appcelerator Studio 4.0.1
      Mac OSX Yosemite
      Titanium SDK 4.0.0

      Description

      When I create a CommonJS Module, any exported method is accessible.

      In detail for the module I've:

      1. Created a new Mobile Module Project, from Appcelerator Studio, with id (for example) it.module.test
      2. Inside assets folder, I've created a js file called it.module.test.js
      3. Into it.module.test.js I have:

        exports = { 
           something: "hi" 
        }
        

      Now I package this module directly from Appcelerator Studio and install this module inside a Test Application.

      Into this application I do:

      var module = require("it.module.test");
      Ti.API.info(module.something);
      

      And the result is null.

      It seems that the problem is that the native module classes have being called instead of the CommonJS ones as per the docs.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Andrea.Vitale Andrea Vitale
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

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

                    Git Source Code