Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3090] Trying to create simple CommonJS module seems to fail in Ti Studio with Sk 1.7.1

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2011-07-09T12:32:47.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsdefect
ReporterByron Davies
AssigneeTony Guntharp
Created2011-07-03T10:16:49.000+0000
Updated2016-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(); --------------

Comments

  1. Paul Dowsett 2011-07-09

    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
  2. Paul Dowsett 2011-07-09

    Reopening due to incorrect resolve reason :/

JSON Source