question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_directives.length ERROR: Cannot read property 'length' of null

See original GitHub issue

Using Vueify in an app (compiled in DEV) I get the following error:

Uncaught TypeError: Cannot read property 'length' of null

From script.js:7557

var originalDirCount = vm._directives.length

I use no custom directives. Error occurs only sometimes, very weird.

Any idea anyone? Thanks!

More context on script.js:

/**
       * A linker function to be called on a already compiled
       * piece of DOM, which instantiates all directive
       * instances.
       *
       * @param {Vue} vm
       * @param {Element|DocumentFragment} el
       * @return {Function|undefined}
       */

      return function link (vm, el) {
        var originalDirCount = vm._directives.length
        if (paramsLinkFn) paramsLinkFn(vm, el)
        if (nodeLinkFn) nodeLinkFn(vm, el)
        if (childLinkFn) childLinkFn(vm, el.childNodes)

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
yyx990803commented, May 19, 2015

Closing since this has most likely been fixed by v-if and transclusion refactor.

0reactions
jcofflandcommented, Feb 7, 2015

Please see my comment on issue #654 above. I believe these issue are not the same but are related.

Events can cause components to be added or removed by changing variables which effect v-if or v-component="{{someVar}}". This alters event propagation. In the case of #654, the list of event listeners may change while the event code is traversing that same list.

I think the event propagation code should make a copy of the event listener list when it begins processing the list. Then while iterating through the list it should check that each listener still exists before calling update().

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'length' of null (javascript) - Stack Overflow
When you are trying to read the property length, the system cant as it is trying to deference a null variable. You need...
Read more >
Uncaught TypeError: Cannot read property 'length' of null error
Hello, I am getting the error “Uncaught TypeError: Cannot read property 'length' of null” in the console and cannot figure out why this...
Read more >
Cannot read property "length" from null - ServiceNow
I have written a script to find some specific content from all HTML fields from knowledge articles but getting below error when there...
Read more >
bug(cdk): Update Failed : Cannot read property 'length' of null ...
I have manually log the path, the error is throw on the first path : Repository is not clean. Update changes will be...
Read more >
TypeError: Cannot read property 'length' of Null in JS
The "Cannot read property 'length' of null" error occurs when accessing the length property on a null value. To solve the error, make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found