tonylukasavage / ti-commonjs

node.js-style commonjs implementation for Titanium 3.X
MIT License
35 stars 8 forks source link

"module.require" breaking android #19

Closed tonylukasavage closed 10 years ago

tonylukasavage commented 10 years ago

Assigning to module.require seems to entirely break tirequire() functionality on android. Need to see if there's a way around this, which there may not be since module.require is assigning to the Titanium module proxy object. If there is no way to handle it directly, then it needs to be noted in the caveats and should probably have some indication of failure in the app.

tonylukasavage commented 10 years ago

There doesn't appear to be an obvious way around this that doesn't involve changes to Titanium. Long story short, tirequire references module.exports. If I change module.exports to reference ti-commonjs, tirequire then also references ti-commonjs, which destroys the the possibility to use the basic Titanium require(), which is currently important for Alloy to function properly.

Given that this is not a commonly used functionality, I'm going to close this and simply note in the documentation that Android will not support module.require. I will re-open the issue if anyone asks for this to be revisited.