Skip to content

Regression between 0.6.12 and 0.7.1: visitTagAndFinalize is not a function #171

@jpd236

Description

@jpd236

I'm working on a Kotlin project which targets the browser (specifically for a Chrome extension). I have a simple snippet of code to append a link to an HTMLDivElement:

body.append {
    a {
        attributes["download"] = filename
        href = dataUrl
        +filename
    }
}

When my project depends on kotlinx-html-js 0.6.12, this works fine.

When I upgrade to 0.7.1 or newer, I get an error: TypeError: visitTagAndFinalize is not a function. The line of code in the generated Javascript that's failing is:

Kotlin.isType(tmp$ = visitTagAndFinalize(new A_init(attributesMapOf(['href', null, 'target', null, 'class', null]), $receiver), $receiver, visitAndFinalize$lambda(block)), HTMLAnchorElement_0) ? tmp$ : throwCCE();

visitTagAndFinalize is undefined, per the debugger. It's initialized here:

var visitTagAndFinalize = $module$kotlinx_html_js.kotlinx.html.visitTagAndFinalize_g9qte5$;

I see in the release notes that there's a change related to this function in 0.7.1 (see #130). Could this be related?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions