Skip to content

Template tags that end with a whitespace cause an error #108

@oskarrough

Description

@oskarrough

Template tags that end with a whitespace cause an error. Here's an example. Notice the whitespace between </host> and the ending backtick.

function component() {
  return html`<host><p>Hello</p></host> `
}

Uncaught (in promise) TypeError: result.render is not a function

from https://github.com/atomicojs/atomico/blob/master/src/element/custom-element.js#L138-L139/

If I remove the whitespace, all is good. You could argue, why put a whitespace there anyway? And that's a fair question, but prettier is doing that for whatever reason.

  • Browser Edge 115.0
  • Vite 4.4.8
  • Atomico 1.72.0

Expected behavior

I'd expect the template to render whether it ends in a whitespace or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions