Skip to content

bug: webc:for does not work with any Iterable #179

@Zearin

Description

@Zearin

I’m trying to loop over some data in a WebC component. After struggling on and off for a few weeks, I remembered that I could set breakpoints in VSCode and use the debugger to hone in on the problem.

I discovered this line of the ast, where loopContent is a JavaScript Map object, but (inside of async getLoopContent()), the AST call to Looping.parse() has reported its type as Array.

Since the AST is expecting an array, it when it tries to call .map() on loopContent, it throws.

(I tried using both webc:for="(key, val) of this.$data and webc:for="(key, val) of this.$data.entries(). The same error happens, because neither are actually an Array object, but Map and MapIterator.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions