Titanium Code Processor: ti.cloud ACS module breaks script

64 views
Skip to first unread message

Daniel Weinstein

unread,
Nov 30, 2012, 3:07:06 PM11/30/12
to appc-...@googlegroups.com

Thanks again for this code processor. I've gotten it running on the KitchenSink project.

I get an undefined ModuleEntry error when I run the code processor on Ti Mobile projects that use ACS whose commonjs module "ti.cloud" is included in the sdk, e.g., at /Library/Application Support/Titanium/modules/commonjs/ti.cloud/2.2.0 . 

In these projects, tiapp.xml loads <module platform="commonjs" version="2.2.0">ti.cloud</module>

/usr/local/bin/titanium-code-processor  -o iphone acsdemo
info: Analyzing project at "[omitted]/acsdemo"

/usr/local/lib/node_modules/titanium-code-processor/bin/codeprocessor:301
                                                                                                modules[platform][name] = path.join(moduleEntry.modulePath, JSON.p
                                                                                                                                               ^
TypeError: Cannot read property 'modulePath' of undefined
    at async.series.async.parallel.options.modules (/usr/local/lib/node_modules/titanium-code-processor/bin/codeprocessor:301:60)
    at Array.forEach (native)
    at /usr/local/lib/node_modules/titanium-code-processor/bin/codeprocessor:280:20
    at async.parallel (/usr/local/lib/node_modules/titanium-code-processor/node_modules/async/lib/async.js:476:17)
    at async.forEach (/usr/local/lib/node_modules/titanium-code-processor/node_modules/async/lib/async.js:94:25)
    at async.parallel (/usr/local/lib/node_modules/titanium-code-processor/node_modules/async/lib/async.js:473:21)
    at async.series.tasks.project (/usr/local/lib/node_modules/titanium-code-processor/bin/codeprocessor:226:8)
    at ChildProcess.exithandler (child_process.js:538:7)
    at ChildProcess.EventEmitter.emit (events.js:99:17)
    at maybeClose (child_process.js:638:16)

I get rid of the undefined moduleEntry error if I remove the ti.cloud module line from tiapp.xml. I've reproduced this error with all the ACS projects I tested including the ACS example shipped in the Ti SDK. I reproduced this error while processing the KitchenSink project by adding that module line to its tiapp.xml.

-Daniel

Bryan Hughes

unread,
Nov 30, 2012, 3:21:36 PM11/30/12
to appc-...@googlegroups.com
Thanks for the heads up. That error makes sense given how Ti.cloud is linked in to projects under the hood. I created a JIRA ticket for this issue: https://jira.appcelerator.org/browse/TIMOB-11911 that you can track. I should be able to fix it in the next day or two.

Bryan Hughes

unread,
Nov 30, 2012, 6:55:28 PM11/30/12
to appc-...@googlegroups.com
After digging into it some more, I can't seem to reproduce your bug. Would you mind posting the <modules> section of your tiapp.xml?

Daniel Weinstein

unread,
Nov 30, 2012, 8:10:19 PM11/30/12
to appc-...@googlegroups.com

My modules section shows:

<modules>

        <module platform="commonjs" version="2.2.0">ti.cloud</module>

</modules>

I can fix this error by changing the version number from 2.2.0 to 2.3.0 .

-Daniel

Bryan Hughes

unread,
Nov 30, 2012, 9:02:20 PM11/30/12
to appc-...@googlegroups.com
I just release 0.1.9 of the code processor that includes a fix for this bug. Turns out, I wasn't checking for the case where the module exists, but not the specified version.

Daniel Weinstein

unread,
Dec 4, 2012, 12:30:04 PM12/4/12
to appc-...@googlegroups.com
In my Titanium Application Support folders the different versions of ti.cloud all exist, but the location of the ti.cloud module in the sdk changed in 2.3.0 to

/Users/[user]/Library/Application Support/Titanium/modules/commonjs/ti.cloud/

from 

/Library/Application Support/Titanium/modules/commonjs/ti.cloud .

The old location had been used for ti.cloud versions up to 2.2.0.

I've updated my projects to use 2.3.0.

-Daniel
Reply all
Reply to author
Forward
0 new messages