[AC-3090] Trying to create simple CommonJS module seems to fail in Ti Studio with Sk 1.7.1
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-07-09T12:32:47.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | defect |
Reporter | Byron Davies |
Assignee | Tony Guntharp |
Created | 2011-07-03T10:16:49.000+0000 |
Updated | 2016-03-08T07:48:08.000+0000 |
Description
Trying Ti create a simple CommonJS JavaScript module. Once the require()statement is called and assigned to a variable, trying to call an exported function failed with a 'not a Ti function'.
I've seen a QA entry where someone has seen a similar issue.
Eg:
module.js:
export.init = function(args) {
//Do something
}
-------------
app.js:
var tmp = require('module');
tmp.init();
--------------
Bryon Have you followed the guide on this? It's a bit hidden away, admittedly. See [Building JavaScript Native Modules](http://wiki.appcelerator.org/display/guides/Module+Developer+Guide+for+iOS#ModuleDeveloperGuideforiOS-BuildingJavaScriptNativeModules). Go through that and try again. Also you have missed some vital information, detailed in the [Jira Ticket Checklist](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist). I'm closing for now, but will be happy to reopen if it transpires that there really is a bug. Cheers
Reopening due to incorrect resolve reason :/