# Não consigo fazer o JS no meu componente compilar. Erro de sintaxe: campo privado deve ser usado em uma classe envolvente

**URL:** https://meta.discourse.org/t/cannot-get-the-js-in-my-component-to-compile-syntaxerror-private-field-must-be-used-in-an-enclosing-class/327492
**Category:** Development
**Created:** [21 Setembro , 2024 04:52 UTC](https://meta.discourse.org/t/cannot-get-the-js-in-my-component-to-compile-syntaxerror-private-field-must-be-used-in-an-enclosing-class/327492 "2024-09-21T04:52:21Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [21 Setembro , 2024 15:50 UTC](https://meta.discourse.org/t/cannot-get-the-js-in-my-component-to-compile-syntaxerror-private-field-must-be-used-in-an-enclosing-class/327492/12 "2024-09-21T15:50:53Z")

</div>

Observação: A Lista de Tópicos atualmente não é convertida para Glimmer.

No entanto, se você estiver anexando Componentes a Plugin Outlets, deverá usar Glimmer.

Se você tiver que anexar a um widget, poderá usar RenderGlimmer para conseguir isso.

Exemplo aqui:

> <https://github.com/merefield/discourse-tc-bars-tag-intersection-chooser/blob/d032a1c38200eecbd6a747f2880b4bd2bc3804e8/javascripts/discourse/widgets/layouts-tag-combo.js.es6#L33>

Imploro que você não confie demais em LLMs sem aprender os fundamentos por si mesmo primeiro, pois você precisa ser o controle de qualidade final do que o LLM está produzindo.

Você também precisa arquitetar a solução corretamente.

Leia mais sobre EmberJS aqui:

> **[Templates are HTML - Components - Ember Guides](https://guides.emberjs.com/release/components/)**
>
> At its core, Ember's UIs are HTML driven - every part of the UI that is shown to the user is defined in a component template somewhere in your application. Because of this, templates are central to Ember, and one of the most important parts of the...

---

_[View the full topic](https://meta.discourse.org/t/cannot-get-the-js-in-my-component-to-compile-syntaxerror-private-field-must-be-used-in-an-enclosing-class/327492)._
