Skip to content


Uncaught TypeError: Cannot read property 'sub' of undefined #169

toddb opened this Issue · 6 comments

2 participants


Runtime error (Chrome and Mozilla)

Uncaught TypeError: Cannot read property 'sub' of undefined jsviews-1.0pre.js:31
(anonymous function) jsviews-1.0pre.js:31
(anonymous function) jsviews-1.0pre.js:1239

Found in v1.0pre pre beta commit counter: 21
Severity: Low

I use requirejs for managing dependencies and loading.

Here is my boostrap:

] );

Of course, if was a loading order issue:


However, you have guards earlier in the code (lines 16-21):

if (!$) {
    // jQuery is not loaded.
    throw "requires jQuery"; // for Beta (at least) we require jQuery

if ($.link) return; // JsViews is already loaded

Is it worth a guard for runtime load order problems?


Yes, fair enough. Adding this to upcoming bits:

if (!$.views) {
    // JsRender is not loaded.
    throw "requires JsRender"; // JsRender must be loaded before JsViews

Cheers. It is such a small thing!

@toddb toddb closed this
@toddb toddb reopened this

Small, but hey :)


This is a JsViews bug, not a JsRender bug, Fix coming in JsViews update 22.


Nice. Thanks

@BorisMoore BorisMoore added a commit that referenced this issue
@BorisMoore Commit counter 22. Major update, including some BREAKING CHANGES, and…
… many

new features. More samples and documentation for new features will be added
incrementally in coming updates.

Among the changes:

Detailed APIs modified for consistent arguments and use of this
pointer, and for maximum extensibility. See updated samples for usage...

Compiled templates restructured for easier debugging.

View object restructured for clarity.

View now has a type property, e.g. type="item"
Only "item" views have index properties, but to get the index from a nested
view use view.get("item").index.

nodes collection on a view is now a function, view.nodes().

Settings grouped onto a $.views.settings object.
View navigation features improved, with view.get(...) and $.view(elem, ...)
tagCtx object provides improved access to the args and properties of a tag

Adding resources (helpers, converters, tags, etc) to a template now supported
by passing parent template to API. e.g. $.tags({...}, parentTemplate).
Many improvements to custom tags, - used also as part of JsViews integration
for new JsViews Tag Controls. (Instantiation of tags as control instances).

Template inclusion now supported with simpler syntax {{for tmpl=.../))

Fixes for issues #169, #162, #157, #156, #155, #153, #145

Done, in update 22.

@BorisMoore BorisMoore closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.