Skip to content

Using the lwc:inner-html directive on a void element with the @lwc/ssr-compiler does not throw #5006

Open
@jhefferman-sfdc

Description

@jhefferman-sfdc

Description

@lwc/ssr-compiler behavior:
When rendering a void (self closing) element with the lwc:inner-html directive, the compiler does not throw, but renders the element without any children.

@lwc/engine-server (expected) behavior:
When rendering a void element with lwc:inner-html using @lwc/engine-server, the compiler does not render and an error is thrown.

Steps to Reproduce

<template>
   <input type="text" lwc:inner-html="child content">
   <span  lwc:inner-html="child content"></span>
</template>

Expected Results

The error Invalid count value is logged and the template is not rendered

Actual Results

The input is rendered as a void element without children and the compiler does not throw

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUG P3SSRUSER STORYUp for grabsIssues that are relatively small, self-contained, and ready for implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions