Skip to content
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
Assignees
Labels

Comments

@pragmaproducts
Copy link

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:[email protected]",
    "aurelia-framework": "npm:[email protected]",
    "aurelia-ui-virtualization": "npm:[email protected]",

main setup:

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

AStoker commented Jun 27, 2017

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

Also, more details on the error would be helpful.

@caperavensoftware
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
Copy link

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
Copy link
Contributor

this one can be closed (-:

@Alexander-Taran
Copy link
Contributor

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

@ciriousjoker
Copy link

Why is this still open?

@Alexander-Taran
Copy link
Contributor

@EisenbergEffect can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants