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

null reference problem in liverange.js #142

Closed
tmeasday opened this Issue May 16, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@tmeasday
Contributor

tmeasday commented May 16, 2012

Hey, I'm getting the following error:

Uncaught TypeError: Cannot read property 'nextSibling' of null
Meteor.ui._LiveRange.visit.recurse liverange.js:300
Meteor.ui._LiveRange.visit.recurse liverange.js:311
Meteor.ui._LiveRange.visit.recurse liverange.js:318
Meteor.ui._LiveRange.visit.recurse liverange.js:311
Meteor.ui._LiveRange.visit.recurse liverange.js:318
Meteor.ui._LiveRange.visit liverange.js:325
cleanup_range liveui.js:532
Meteor.ui._intelligent_replace liveui.js:382
Meteor.ui._LiveRange.operate liverange.js:438
Meteor.ui._intelligent_replace liveui.js:380
Meteor.ui.render liveui.js:138
Meteor.ui._wire_up liveui.js:416
_.extend.flush deps.js:63
_.each._.forEach underscore.js:76
_.extend.flush deps.js:62
_.each._.forEach underscore.js:76
_.extend.flush

As far as I can tell I'm not doing anything particularly wacky, here's the usage:

<template name="screens">
   <div class="container {{ visible_page }}">
   ...snip
</template>
Template.screens.visible_page = function() {
  return Session.get('visible_page') || 'home';
};

I'm not really sure how to proceed, I'm not really understanding what the liverange datastructure does exactly. Let me know how I can dig further.

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented May 17, 2012

Alright, I managed to reduce it right down via selective deleting :).

Here's a simple as I can get it and still trigger the problem: https://gist.github.com/gists/2716855

I believe the real reason for the problem is that the two inputs have the same name attribute, but it goes away if you simplify the html / template hierarchy at all from this point.

I think that's all I can provide; let me know if you need anything further.

@dgreensp dgreensp closed this in 57b13fd May 23, 2012

@dgreensp

This comment has been minimized.

Contributor

dgreensp commented May 23, 2012

Thanks for this great bug report!

I was able to track the problem down to a low-level routine. The issue is fixed on the "devel" branch and will go into the next release.

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented May 23, 2012

Thanks David, happy to help. Glad you guys were able to fix it..

@ai10

This comment has been minimized.

ai10 commented Oct 4, 2013

I am using Bootstrap3 'alerts' which completely removes the alert div from the page on 'click.'
I put these alerts in a list with

{{#each alerts}}
{{> alertItem}}
{{/each}}

sometimes after an alert has been clicked off; and a new alert is added to the Alerts collection I get

Uncaught TypeError: Cannot read property '_spark_2iMqJjS8jdXWcXqcL' of null liverange.js:662
enclosingRangeSearch liverange.js:662
LiveRange.findParent liverange.js:630
findRangeOfType spark.js:90
(anonymous function) spark.js:727
(anonymous function) listener.js:108
.each..forEach underscore.js:79
deliver listener.js:102
_.extend.handler

also
Exception from Deps recompute: TypeError: Cannot read property 'nextSibling' of null
at recurse (http://localhost:3000/packages/liverange.js?b3097d72d458e645fd4f0021c8ff5189abe8d98a:353:20)
at recurse (http://localhost:3000/packages/liverange.js?b3097d72d458e645fd4f0021c8ff5189abe8d98a:364:11)
at recurse (http://localhost:3000/packages/liverange.js?b3097d72d458e645fd4f0021c8ff5189abe8d98a:364:11)
at recurse (http://localhost:3000/packages/liverange.js?b3097d72d458e645fd4f0021c8ff5189abe8d98a:364:11)
at recurse (http://localhost:3000/packages/liverange.js?b3097d72d458e645fd4f0021c8ff5189abe8d98a:364:11)
...

I can solve this problem at a higher level; but the unexpected null for liverange end could be accounted for in core I think.

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