I’m using Aurelia and aurelia-web-components plugin to provide reusable webcomponents compliant custom-elements. I’d like to have aurelia custom-element forward compatible with webcomponents - so to have with same name or prefix. Recently, I don’t know if I’m doing something wrong or I discovered a possible bug which prevents composite webcomponents to be rendered.
My composite component <bdl-beakercontrol>
template uses <bdl-range>
and <bdl-beaker>
. All these are registered as webcomponents too - using same name (with bdl- prefix). Browser don’t show <bdl-beakercontrol>
and throws error:
Uncaught TypeError: instruction is undefined
applyInstructions aurelia-templating.js:2211
create aurelia-templating.js:2471
create aurelia-templating.js:4108
auInit aurelia-web-components.js:46
attributeChangedCallback aurelia-web-components.js:66
registerBehavior aurelia-web-components.js:178
useGlobalElements aurelia-web-components.js:164
useGlobalElements aurelia-web-components.js:162
configure webcomponents.js:31
while the simple components <bdl-range>
and <bdl-beaker>
are rendered correctly - as they are not composed from other aurelia components.
A workaround seems to have different component name in aurelia and use fallback prefix in webcomponents plugin. But I’d rather have webcomponent names or prefix same as aurelia components.
Quick repo to reproduce this problem is at https://github.com/TomasKulhanek/bodylight-aurelia-webcomponent-bug.git
To live preview this problem https://tomaskulhanek.github.io/bodylight-aurelia-webcomponent-bug/dist/