# Problemas ao carregar um asset js de um Componente de Tema

**URL:** <https://meta.discourse.org/t/issues-on-loading-a-js-asset-from-a-theme-component/279792>\
**Category:** Development\
**Created:** [22 Setembro , 2023 13:39 UTC](https://meta.discourse.org/t/issues-on-loading-a-js-asset-from-a-theme-component/279792 "2023-09-22T13:39:14Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![happycactus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/happycactus/32/328435_2.png) [@happycactus](https://meta.discourse.org/u/happycactus)\
**Post date:** [28 Setembro , 2023 20:39 UTC](https://meta.discourse.org/t/issues-on-loading-a-js-asset-from-a-theme-component/279792/18 "2023-09-28T20:39:58Z")

</div>

Olá @hawm , descobri por que não está funcionando e estou travado.  
Claro, sou totalmente novo no Ember e em JavaScript recente em geral. Então, estudei um pouco e descobri o motivo.  
O PgnViewerJs espera funcionar no DOM real, não no DOM Virtual. Portanto, mesmo depois que o elemento preparado foi adotado, ele não está presente no DOM real, e o PGNV procura por IDs usando document.getElementById.  
Estudei tudo o que pude encontrar: os componentes Ember parecem atender às minhas necessidades, mas não tenho certeza de como lidar com isso.  
Ou talvez `API.onAppEvent`?

Obrigado.

---

_[View the full topic](https://meta.discourse.org/t/issues-on-loading-a-js-asset-from-a-theme-component/279792)._
