WebReflection / uhtml

A micro HTML/SVG render
MIT License
916 stars 37 forks source link

Cannot render empty array #91

Closed lazex closed 11 months ago

lazex commented 11 months ago

If the array is empty, render is failed.

import { html, render } from "uhtml"

render(
  document.querySelector('#app'),
  html`
    <h1>foo</h1>
    <div>${[]}</div>
  `
)

The error is here.

Failed to execute 'setStartBefore' on 'Range': parameter 1 is not of type 'Node'.
WebReflection commented 11 months ago

Ooops, silly mistake, fixed, thanks!

WebReflection commented 11 months ago

to clarify, this issue was happening only if you start with an empty array ... now that's fixed, changing from non-empty to empty then non-empty again worked well, sorry for the issue.