Skip to content

TreeView: Including dependency for 'gallery-itsatoolbar' causes error. #29

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

Open
davewallace opened this issue Jul 4, 2013 · 5 comments
Assignees

Comments

@davewallace
Copy link

Hi there,

I have 2 test files, one (which functions as expected) with these dependencies declared in the use() method: ['gallery-sm-treeview','gallery-sm-tree-lazy','editor'].
http://codefinger.co.nz/public/yui/yui-editor-treeview/index2.html

The other test file is basically the same, but has the 'gallery-itsatoolbar' as an additional dependency:
http://codefinger.co.nz/public/yui/yui-editor-treeview/index.html

With the second test file, I get this error in Chrome inspector:
Uncaught TypeError: Cannot read property 'prototype' of undefined tree.js:743

So I'm unsure which module is causing the error, though the error is in tree.js, I might need to submit an issue with the creator of 'gallery-itsatoolbar', but I don't know sorry.

@rgrove
Copy link
Contributor

rgrove commented Jul 4, 2013

Yep, you should contact the author of gallery-itsatoolbar.

@rgrove rgrove closed this as completed Jul 4, 2013
@ItsAsbreuk
Copy link

Hey Ryan,

As creator of itsatoolbar, I dived into this, but the issue is not purely this module and seems far more complex. As far as I can see, it is the loader that causes this. If so, than it goes beyond my knowledge.

This is what I found out:

  • Looking at the dependencies of David's second example: if you replace gallery-itsatoolbar by ANY gallery-module that depends on 'widget' you see the same error.
  • I checked 'itsa-selectlist' --> If I create a test page where I do not load 'gallery-itsaselectlist' through the loader, but add the code manually (YUI.add), there is NO error. Take a look at the differences: http://projects.itsasbreuk.nl/test-examples/testok.html and http://projects.itsasbreuk.nl/test-examples/testerror.html
  • If I create a basic module AND load it through the loader (needed to create the error), it also throws an error:
YUI.add('gallery-itsaselectlist', function (Y, NAME) {

Y.ITSASelectList = Y.Base.create('itsaselectlist', Y.Widget, [], );

}, '@VERSION@', {"requires": ["base-build", "widget"], "skinnable": false});
  • If the "widget" dependency is replaced by "base" than there is NO error:
YUI.add('gallery-itsaselectlist', function (Y, NAME) {

Y.ITSASelectList = Y.Base.create('itsaselectlist', Y.Base, [], );

}, '@VERSION@', {"requires": ["base-build", "base-base"], "skinnable": false});

I hope it makes sense and you can reproduce the issue.
Marco.

@ItsAsbreuk
Copy link

Thinking more about it: It might as well be the order of loading the modules. That is, it could be that the error only occurs if "widget" is loaded after gallery-sm-treeview. If I manually use YUI.add(), then it is loaded before.

@rgrove
Copy link
Contributor

rgrove commented Jul 19, 2013

@ItsAsbreuk Thanks for digging in! I'm pretty busy with work right now, but I'll investigate as soon as I have time. This does sound like something weird in Loader.

@rgrove rgrove reopened this Jul 19, 2013
@ghost ghost assigned rgrove Jul 19, 2013
@ItsAsbreuk
Copy link

You're welcome.

As far as I can see at this moment it is the order of loading the modules. The error-example puts the widgets-modules almost at the bottom: after 'tree' and before 'gallery-sm-tree'. Whereas the working examples have 'widget' loaded before 'tree'.

Perhaps you'll find Y.Widget to insert extra items in nodeExtensions[] after Tree is initialized, because it error on line https://github.com/yui/yui3/blob/master/build/tree/tree-debug.js#L761, saying 'nodeExtentions[i]' is undefined.

Anyway, good luck.

Marco.

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

No branches or pull requests

3 participants