# Web-components we no app root

**URL:** <https://discourse.aurelia.io/t/web-components-we-no-app-root/6439>\
**Category:** vNext\
**Created:** [May 19, 2025, 10:28am UTC](https://discourse.aurelia.io/t/web-components-we-no-app-root/6439 "2025-05-19T10:28:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivan](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ivan/32/2022_2.png) [@ivan](https://discourse.aurelia.io/u/ivan)\
**Post date:** [May 19, 2025, 10:28am UTC](https://discourse.aurelia.io/t/web-components-we-no-app-root/6439/1 "2025-05-19T10:28:12Z")

</div>

I would like to use Aurelia 2 to develop two web-components that I can use on a third party site.

In `main.ts`

```auto
...
import { ComponentOne } from './resources/components/component-one'
import { ComponentTwo } from './resources/components/component-two'
...
Aurelia
  .register(AppTask.creating(IWcElementRegistry, registry => {
    registry.define('component-one', ComponentOne)
    registry.define('component-two', ComponentTwo)
  }))
  .app(class App {})
  .start()

```

Now when I import the created bundle into the third party site. I just need to add this in the html

```auto
<component-one></component-one>
<component-two></component-two>

```

To get them to render.

From some initial testing it seems to work. However, there is one error in the webdev console:

```auto
app-root.ts:96 Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener')

```

I am guessing this is just do to the fact that the app root does not have a actual HTML element.

Will this cause issues in the future? Does this approach even make sense?

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [May 22, 2025, 6:46am UTC](https://discourse.aurelia.io/t/web-components-we-no-app-root/6439/2 "2025-05-22T06:46:59Z")

</div>

Are you able to create a small repro for this issue?
