Skip to content

Error: Unrecognized Tag

Patrick Steele-Idem edited this page Feb 8, 2017 · 11 revisions

Error: Unrecognized tag

When Marko encounters an unrecognized tag at compile-time it will throw an error by default. For example:

[template.marko:0:1] Unrecognized tag: invalid-tag

This allows Marko to catch potential problems as early as possible, but it does require that Marko be aware of all of the possible tag names (including tag names for standard HTML elements, Marko UI components and custom HTML elements).

If you are wanting to use an HTML custom element in your Marko template and you want the element to passthrough then you will need to register the custom element. Simply create a html-elements.json in the same directory or a higher up directory and register the tag as shown below.

For example:

Input template:

src/components/hello/index.marko:

<my-custom-element name="Frank" />

src/html-elements.json:

{
  "<my-custom-element>": {}
}

With that change in place, the Marko compiler will not complain that the <my-custom-element> tag is unrecognized.

Clone this wiki locally