流星:排队任务中的​​异常:错误:无法在“节点"上执行"removeChild":要删除的节点不是该节点的子节点 [英] Meteor: Exception in queued task: Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node

查看:532
本文介绍了流星:排队任务中的​​异常:错误:无法在“节点"上执行"removeChild":要删除的节点不是该节点的子节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的有个奇怪的问题,完全不知道如何解决.

I have really weird problem and totally no clue how to solve it.

我正在尝试构建非常简单的fullpage.jsmeteor.js实现.下面的代码有效,但是几分钟后,它中断了.当我打开一个新的隐身窗口时,它会再次运行几分钟,但是当我刷新页面时,我会收到3次以下错误(集合中的每个文档一个).

I am trying to build very simple fullpage.js and meteor.js implementation. The code below works, but after a few minutes, it breaks. When I open a new incognito window it works for a few minutes again, but when I refresh the page I get the following error 3 times (one for each document in collection).

Exception in queued task: Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at Error (native)
at DOMRange.detach (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:512:24)
at DOMRange.setMembers (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:471:12)
at DOMRange.addMember (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:540:10)
at http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2541:32
at Object.Tracker.nonreactive (http://localhost:3000/packages/tracker.js?517c8fe8ed6408951a30941e64a5383a7174bcfa:513:12)
at Object.Blaze.Each.eachView.onViewCreated.eachView.stopHandle.ObserveSequence.observe.addedAt (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2528:17)
at Object.cursor.observe.addedAt (http://localhost:3000/packages/observe-sequence.js?2fd807ea171ead273b9e6458607cb226012d9240:339:19)
at LocalCollection._observeFromObserveChanges.observeChangesCallbacks.addedBefore (http://localhost:3000/packages/minimongo.js?e8806aa7782b729b2517ebc0cd10b321667f1427:3840:28)
at Object.LocalCollection._CachingChangeObserver.self.applyChange.addedBefore (http://localhost:3000/packages/minimongo.js?e8806aa7782b729b2517ebc0cd10b321667f1427:3777:56)

Meteorpad: http://meteorpad.com/pad/RT4HwXmXW6wbghNhK/Fullpage

Meteorpad: http://meteorpad.com/pad/RT4HwXmXW6wbghNhK/Fullpage

main.html

<head>
    <title>Title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

<body>
    {{>fullPage}}
</body>

<template name="fullPage">
        <div id="fullpage" class="section">
                {{#each products}}
                    <div class="slide"><h2>{{name}}</h2></div>
                {{/each}}
            </div>
</template>

client/app.js

Template.fullPage.rendered = function () {
    $('#fullpage').fullpage();
};

Template.fullPage.helpers({
    products: function () {
        return Products.find();
    }
});

server/app.js

Meteor.startup(function () {
  if (Products.find().count() === 0) {

    var Product1 = Products.insert({
        name: "1"
    });

    var Product2 = Products.insert({
        name: "2"
    });

    var Product3 = Products.insert({
        name: "3"
    });
  }
});

common.js

Products = new Mongo.Collection('products');

推荐答案

{{#each products}}周围添加<div>可能会解决您的问题.

Adding a <div> around your {{#each products}} may solve your problem.

我对fullpage.js并不熟悉,但是我通过maazalik:malihu-jquery-custom-scrollbar软件包得到了完全相同的错误消息.该插件通过将元素复制并粘贴到新的div中来进行操作,如果该元素的第一个子元素是{{#each}}{{#if}},则可能导致问题.添加<div>可以解决该问题.

I'm not familiar with fullpage.js, but I was getting the exact same error message with the maazalik:malihu-jquery-custom-scrollbar package. The plugin operates by copying and pasting elements into a new div, which can cause problems if the first child of that element is an {{#each}} or {{#if}}. Adding a <div> solves that.

您可以在此 github问题中找到更多信息.

You can find more info in this github issue.

这篇关于流星:排队任务中的​​异常:错误:无法在“节点"上执行"removeChild":要删除的节点不是该节点的子节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆