# Javascript error if emoji\_autocomplete\_min\_chars setting \> 0 for each character typed after a colon in the composer

**URL:** https://meta.discourse.org/t/javascript-error-if-emoji-autocomplete-min-chars-setting-0-for-each-character-typed-after-a-colon-in-the-composer/220163
**Category:** Bug
**Created:** [March 5, 2022, 6:16pm UTC](https://meta.discourse.org/t/javascript-error-if-emoji-autocomplete-min-chars-setting-0-for-each-character-typed-after-a-colon-in-the-composer/220163 "2022-03-05T18:16:04Z")
**Posts on this page:** 6
**Page:** 1

<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: [March 5, 2022, 6:16pm UTC](https://meta.discourse.org/t/javascript-error-if-emoji-autocomplete-min-chars-setting-0-for-each-character-typed-after-a-colon-in-the-composer/220163/1 "2022-03-05T18:16:04Z")

</div>

`Uncaught (in promise) TypeError: e.map is not a function in d.editor`

 ![composer error](https://global.discourse-cdn.com/meta/original/3X/9/a/9a8d70d0f1aa7f5930921d031f601f02432dfc5f.png)

* * *

edit : re-writing now that I have found the cause

After some testing, it appears that this error happens when the **emoji\_autocomplete\_min\_chars** site setting is set to a value different than 0.  
The error will occur each time we type a character after a colon. Also, the colon must be the first character of the line or have a space character before.

If **emoji\_autocomplete\_min\_chars** is set to 3, the error will appear for the first 3 characters typed before the emoji selector is shown.

![composer error](https://global.discourse-cdn.com/meta/original/3X/2/0/20aab702e78347048ebb60f82384bd1c8d00bf4c.gif)

I don’t know if it affects anything or causes unwanted behavior that I can’t see behind the curtains.

* * *

edit: 2.9.0.beta3 and beta2, tried in [safe mode](https://meta.discourse.org/t/53504?silent=true) 🙂

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 28, 2022, 10:46pm UTC](https://meta.discourse.org/t/javascript-error-if-emoji-autocomplete-min-chars-setting-0-for-each-character-typed-after-a-colon-in-the-composer/220163/3 "2022-03-28T22:46:07Z")

</div>

Yikes, let us have a debug of this… will have a look over the next week.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [March 29, 2022, 7:13pm UTC](https://meta.discourse.org/t/javascript-error-if-emoji-autocomplete-min-chars-setting-0-for-each-character-typed-after-a-colon-in-the-composer/220163/5 "2022-03-29T19:13:34Z")

</div>

@j.jaffeux do you mind having a quick look? 👀

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [April 13, 2022, 9:54am UTC](https://meta.discourse.org/t/javascript-error-if-emoji-autocomplete-min-chars-setting-0-for-each-character-typed-after-a-colon-in-the-composer/220163/7 "2022-04-13T09:54:43Z")

</div>

> [@Canapin](#):
>
> emoji\_autocomplete\_min\_chars

Hi,

I will look at writing a test for this after Lunch but just confirming the repro was correct and I have a fix ready soon:

[https://github.com/discourse/discourse/pull/16465](https://github.com/discourse/discourse/pull/16465)

👍

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [April 13, 2022, 1:33pm UTC](https://meta.discourse.org/t/javascript-error-if-emoji-autocomplete-min-chars-setting-0-for-each-character-typed-after-a-colon-in-the-composer/220163/10 "2022-04-13T13:33:01Z")

</div>

Merged thanks for report 👍

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [April 18, 2022, 1:33pm UTC](https://meta.discourse.org/t/javascript-error-if-emoji-autocomplete-min-chars-setting-0-for-each-character-typed-after-a-colon-in-the-composer/220163/11 "2022-04-18T13:33:29Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
