# Register custom element as web component

**URL:** <https://discourse.aurelia.io/t/register-custom-element-as-web-component/1481>\
**Category:** Help Requests\
**Created:** [August 1, 2018, 5:17pm UTC](https://discourse.aurelia.io/t/register-custom-element-as-web-component/1481 "2018-08-01T17:17:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brezma](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@brezma](https://discourse.aurelia.io/u/brezma)\
**Post date:** [August 1, 2018, 5:17pm UTC](https://discourse.aurelia.io/t/register-custom-element-as-web-component/1481/1 "2018-08-01T17:17:41Z")

</div>

I have an Aurelia custom element that I’m trying to render inside a web component template and use elsewhere in my application as a custom element.

I registered the custom element using ComponentRegistry which allows the custom element to render inside a web component. However the same custom element will no longer render as a custom element via compile and attach.

Here’s the stack trace that I’m getting:  
Uncaught TypeError: Cannot read property ‘behaviorInstructions’ of undefined  
at applyInstructions (index.js:21)  
at ViewFactory.create (index.js:21)  
at BoundViewFactory.create (index.js:21)  
at Repeat.addView (index.js:21)  
at ArrayRepeatStrategy.\_standardProcessInstanceChanged (index.js:21)  
at ArrayRepeatStrategy.instanceChanged (index.js:21)  
at Repeat.itemsChanged (index.js:21)  
at Repeat.bind (index.js:21)  
at Controller.bind (index.js:21)  
at View.bind (index.js:21)  
at Repeat.addView (index.js:21)  
at ArrayRepeatStrategy.\_standardProcessInstanceChanged (index.js:21)  
at ArrayRepeatStrategy.instanceChanged (index.js:21)  
at Repeat.itemsChanged (index.js:21)  
at BehaviorPropertyObserver.selfSubscriber (index.js:21)  
at BehaviorPropertyObserver.call (index.js:21)

Any suggestions are appreciated?

Mark

---

<div class="post-metadata">

**Author:** ![brezma](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@brezma](https://discourse.aurelia.io/u/brezma)\
**Post date:** [August 2, 2018, 6:48pm UTC](https://discourse.aurelia.io/t/register-custom-element-as-web-component/1481/2 "2018-08-02T18:48:11Z")

</div>

I was able to resolve the above issue by extending my custom element class and wrapping the custom element in an html file with ‘-wc’ suffix. I then registered the ‘-wc’ version as a web component.
