Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong version of underscore #537

Open
brentonhouse opened this issue Sep 13, 2017 · 4 comments
Open

Wrong version of underscore #537

brentonhouse opened this issue Sep 13, 2017 · 4 comments

Comments

@brentonhouse
Copy link

brentonhouse commented Sep 13, 2017

When I create an app, the first thing I always do is put the contents from lodash.js into /lib/alloy/underscore.js so that I can use lodash instead of the really old version of underscore that is included with alloy.

When I do this with TiShadow, references to _ in my app seem to be pulling from a version of underscore.js that is included in /build/appify/build/Resources/lib/underscore.js. I am outputing _.VERSION right before I am getting undefined errors and it is 1.4.4 and the only reference to that seems to be in the TiShadow underscore file.

Do you know why it would be picking this up? And if so, is there a way of turning that off?

Thanks!

@dbankier
Copy link
Owner

I will look into it. The container app for TiShadow uses underscore including PlatformRequire.js which I think is the issue, as it evaluates your (modified) source code there. At a guess you don't require underscore manually and rely on a global instance so it using the instance of _ required in the container app. Does that makes sense?

@brentonhouse
Copy link
Author

Probably a good idea for me to just start requiring lodash in all my files. Though, I am not sure if it would work with the auto-generated Alloy files like controllers, etc because of where it places the user code in the files. I will do a few more tests with different files to see what happens. Thanks!

@brentonhouse
Copy link
Author

I have created the file /vendor/node_modules/lodash/index.js which contains the latest version of lodash. I then require it using var _ = require('lodash');. This works with TiShadow turned off but when I turn it on, I get: Couldn't find module: lodash for architecture: x86_64.

I am guessing this is a separate issue so I can create a new github issue for this.

Thanks!

@dbankier
Copy link
Owner

Yep. I'm not sure if ts support node_modules base requires (I haven't used them). Separate issue, but should be easy to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants