Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Module Development - Getting '[undefined] is not an object' in 1.3.2 and head

Trying to develop a module using the walkthrough document and everything works as expected all the way up until I try and use the module, where I get an "[undefined] is not an object" error. I know this was an issue in previous versions of Titanium, but I thought it had been fixed. Tried it with 1.3.2, and built from head at around 1pm today, but no luck. Has this regressed recently?

I see this in the log which leads me to believe the my "TestingModule" module loaded successfully:

"[INFO] Detected third-party module: testingmodule/0.1"

But this fails:

var test = Titanium.Testing;

Any help is greatly appreciated. Under a time constraint here and really need to develop a critical module.

— asked July 1st 2010 by Alan McConnell
  • iphone
  • mobilesdk
  • module

1 Answer

  • Hey Alan,

    We're making some changes to the Module SDK and haven't yet posted some of the docs yet.

    You should be able to use

    var mymodule = require("testingmodule");

    Now as the syntax. We're moving to common js syntax to prevent namespace issues. Also, you'll want to move to using dotted notation naming. The new syntax will use the module id (such as com.foo.bar) in the require statement.

    — answered July 1st 2010 by Jeff Haynie
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.