_directives.length ERROR: Cannot read property 'length' of null
See original GitHub issueUsing 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:
- Created 9 years ago
- Comments:6 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing since this has most likely been fixed by
v-if
and transclusion refactor.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
orv-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()
.