Skip to content

Chrome won't render search app components that set attributes in constructor #74

@derekenos

Description

@derekenos

When attempting to view the production search app in Chrome, the custom <search-app> element was present in the source but not being rendered. There were no errors reported in the console. Testing locally, I removed the type="module" from the search app import in head.html, reloaded and saw Chrome complain in the console:

Uncaught DOMException: Failed to construct 'CustomElement': The result must not have attributes

See: https://stackoverflow.com/questions/43836886/failed-to-construct-customelement-error-when-javascript-file-is-placed-in-head

Moving the script import from head.html to foot.html appears to fix the problem for now, but we should modify the search app to comply with the guidelines outlined here: https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-conformance

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