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

Uncaught (in promise) TypeError: Cannot read property 'attrToRemove' of undefined #109

Closed
pragmaproducts opened this Issue Jun 22, 2017 · 7 comments

Comments

Projects
None yet
7 participants
@pragmaproducts
Copy link

pragmaproducts commented Jun 22, 2017

Get the top error when running virtual-repeat.for on a li

Usage:

<template>
    <ul>
        <li virtual-repeat.for="item of items">${item.description}</li>
    </ul>
</template>

packages:

    "aurelia-bootstrapper": "npm:aurelia-bootstrapper@2.1.1",
    "aurelia-framework": "npm:aurelia-framework@1.1.2",
    "aurelia-ui-virtualization": "npm:aurelia-ui-virtualization@1.0.0-beta.3.1.0",

main setup:

            .plugin(
                "aurelia-dialog",
                "aurelia-ui-virtualization"
            );
@AStoker

This comment has been minimized.

Copy link
Member

AStoker commented Jun 27, 2017

@pragmaproducts, please reformat this to follow the Issue Template.

Also, more details on the error would be helpful.

@caperavensoftware

This comment has been minimized.

Copy link

caperavensoftware commented Jun 28, 2017

I'm submitting a bug report I'm submitting a feature request

Library Version: 1.0.0-beta.3.1.0
Please tell us about your environment:

Operating System: OSX 10.x|Linux (distro)|Windows [7|8|8.1|10]

Node Version: 8.1

NPM Version: 5 +
JSPM 0.16.32
Browser: all Web Browser
Language: all | ESNext

Current behavior:

Expected/desired behavior:
that i show s a list of items with out throwing errors

What is the expected behavior?
that i show s a list of items with out throwing errors

When binding to a array of 1000 items using repeat.for to render those items works fine.
When changing that to virtual-repeat.for throws this error

ERROR [app-router] TypeError: Cannot read property 'attrToRemove' of undefined
    at ViewCompiler._compileElement (aurelia-templating.js:2839)
    at ViewCompiler._compileNode (aurelia-templating.js:2548)
    at ViewCompiler._compileElement (aurelia-templating.js:2854)
    at ViewCompiler._compileNode (aurelia-templating.js:2548)
    at ViewCompiler._compileNode (aurelia-templating.js:2570)
    at ViewCompiler.compile (aurelia-templating.js:2517)
    at eval (aurelia-templating.js:3218)
    at <anonymous>
error	@	aurelia-logging-console.js:54
(anonymous)	@	aurelia-logging.js:44
processResult	@	aurelia-router.js:1831
(anonymous)	@	aurelia-router.js:1784

the code that executes this is

<li virtual-repeat.for="item of items">${item.title}</li>

the plugin was installed using jspm and added as a plugin in min.js as per git readme page

viewmodel:

export class Longlist {
    @bindable items;

    constructor(eventAggregator) {
        this.eventAggregator = eventAggregator;
    }

    attached() {
        // initialize
        this.items = [];
        for(let i = 0; i < 1000; i++) {
            this.items.push({
                title: `Item ${i}`
            })
        }
    }

    detached() {
        // dispose
    }
}

View

<template>
    <ul style="width: 100%; height: 100%; overflow: auto">
        <li virtual-repeat.for="item of items">${item.title}</li>
    </ul>
</template>
@caperavensoftware

This comment has been minimized.

Copy link

caperavensoftware commented Jun 28, 2017

You can close this item. I found the problem.
It was in the way the plugin was registered.

this is the problem

            .plugin(
                "aurelia-dialog",
                "aurelia-ui-virtualization"
            );

this solved the problem

        aurelia.use.plugin('aurelia-dialog');
        aurelia.use.plugin('aurelia-ui-virtualization');
@Alexander-Taran

This comment has been minimized.

Copy link
Member

Alexander-Taran commented Mar 26, 2018

this one can be closed (-:

@Alexander-Taran

This comment has been minimized.

Copy link
Member

Alexander-Taran commented Mar 26, 2018

@caperavensoftware thank you so much for reporting back your own solution

@CiriousJoker

This comment has been minimized.

Copy link

CiriousJoker commented Jul 12, 2018

Why is this still open?

@Alexander-Taran

This comment has been minimized.

Copy link
Member

Alexander-Taran commented Jul 12, 2018

@EisenbergEffect can be closed

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