# Поделитесь своими украшениями Discourse к Хэллоуину!

**URL:** https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327
**Category:** Community Building
**Created:** [15.Октябрь.2020 23:24:12 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327 "2020-10-15T23:24:12Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [12.Октябрь.2022 11:44:52 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327/24 "2022-10-12T11:44:52Z")

</div>

В этой части возникла ошибка. Похоже, Discourse изменил некоторые методы.

```js
Discourse.appEvents.on('composer:opened', () => {

```

`TypeError: Cannot read properties of undefined (reading 'on')`

Но я недостаточно знаком с разработкой Discourse, чтобы исправить эту ошибку самостоятельно. Если у кого-то есть идея…

---

<div class="post-metadata">

### Author: ![keegan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/keegan/32/383395_2.png) [@keegan](https://meta.discourse.org/u/keegan)
#### Post date: [12.Октябрь.2022 15:53:24 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327/25 "2022-10-12T15:53:24Z")

</div>

@Canapin

Вместо `Discourse.appEvents.on` попробуйте вот это:

```javascript
const appEvents = api.container.lookup("service:app-events");
appEvents.on('composer:opened', () => {

```

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [12.Октябрь.2022 16:21:21 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327/26 "2022-10-12T16:21:21Z")

</div>

К сожалению, это тоже не работает.  
 ![image](https://global.discourse-cdn.com/meta/original/4X/6/6/f/66f362906c6efa469eae9345a7407bfdfb156507.png)

Однако баннера «Ваш сайт сломан» нет

---

<div class="post-metadata">

### Author: ![keegan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/keegan/32/383395_2.png) [@keegan](https://meta.discourse.org/u/keegan)
#### Post date: [12.Октябрь.2022 16:24:50 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327/27 "2022-10-12T16:24:50Z")

</div>

Заключён ли ваш код в теги скрипта плагина? Внутри этих тегов у него должен быть доступ к `api`.

```handlebars
<script type="text/discourse-plugin" version="1.4.0">
...
</script>

```

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [12.Октябрь.2022 16:25:27 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327/28 "2022-10-12T16:25:27Z")

</div>

Да, забыл эту часть.

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [12.Октябрь.2022 16:26:13 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327/29 "2022-10-12T16:26:13Z")

</div>

Сложно его поймать, но оно работает! 🎉

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [26.Октябрь.2022 08:13:42 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327/31 "2022-10-26T08:13:42Z")

</div>

Мой призрак не отображается, появляется битая картинка

[https://i.gyazo.com/0a1a19a81bdb197ba7b2788e409b8856.mp4](https://i.gyazo.com/0a1a19a81bdb197ba7b2788e409b8856.mp4)

> [@Canapin](#):
>
> Загрузите следующее изображение в свою тему/компонент и задайте имя переменной как **fantasma** :

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [26.Октябрь.2022 22:37:06 UTC](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327/32 "2022-10-26T22:37:06Z")

</div>

Можешь сделать скриншот своей темы или компонента темы, куда ты добавил код Хэллоуина? Этот экран, но из твоего форума:

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/8/8/3883190ed610b7ee0070751d2d4570846621a910.png)

Также пришли скриншот секции head в этой теме или компоненте темы, чтобы я мог увидеть код?

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/1/0/3102552e2cf84bc06b5deedfda4a27a38b95be2e.png)

[Предыдущая страница](https://meta.discourse.org/t/share-your-discourse-halloween-decorations/167327.md?page=1)
