Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index error for replace_unified with certain emoji variations #191

Open
StephenTangCook opened this issue Jul 10, 2024 · 0 comments
Open

Comments

@StephenTangCook
Copy link

StephenTangCook commented Jul 10, 2024

I am using replace_unified to get the emoji from unified texts, but it fails for certain emojis with skintone variations. My usage is roughly:

import * as emojiConvertor from 'emoji-js';

emojiConverter.replace_unified(emojiUnified);

The error:

TypeError: Cannot read properties of undefined (reading '8')
    at emoji.replacement (/Users/stephencook/git/tightknit-app/packages/emoji-mapping/dist/create-emoji-mapping.cjs:206:77)
    
compiled.cjs:206
        var text_name = actual ? wrapper + actual + wrapper : self.data[idx][8] || wrapper + self.data[idx][3][0] + wrapper;

which appears to be coming from

var text_name = (actual) ? wrapper+actual+wrapper : self.data[idx][8] || wrapper+self.data[idx][3][0]+wrapper;


This is a subset of the failing emojis:

Error converting emoji with shortname 'woman-heart-man::skin-tone-2-2' and unified '\u{D83D}\u{DC69}\u{D83C}\u{DFFB}\u{200D}\u{2764}\u{FE0F}\u{200D}\u{D83D}\u{DC68}\u{D83C}\u{DFFB}'
Error converting emoji with shortname 'woman-heart-man::skin-tone-2-3' and unified '\u{D83D}\u{DC69}\u{D83C}\u{DFFB}\u{200D}\u{2764}\u{FE0F}\u{200D}\u{D83D}\u{DC68}\u{D83C}\u{DFFC}'
Error converting emoji with shortname 'woman-heart-man::skin-tone-2-4' and unified '\u{D83D}\u{DC69}\u{D83C}\u{DFFB}\u{200D}\u{2764}\u{FE0F}\u{200D}\u{D83D}\u{DC68}\u{D83C}\u{DFFD}'
Error converting emoji with shortname 'people_holding_hands::skin-tone-2-2' and unified '\u{D83E}\u{DDD1}\u{D83C}\u{DFFB}\u{200D}\u{D83E}\u{DD1D}\u{200D}\u{D83E}\u{DDD1}\u{D83C}\u{DFFB}'
Error converting emoji with shortname 'people_holding_hands::skin-tone-2-3' and unified '\u{D83E}\u{DDD1}\u{D83C}\u{DFFB}\u{200D}\u{D83E}\u{DD1D}\u{200D}\u{D83E}\u{DDD1}\u{D83C}\u{DFFC}'
Error converting emoji with shortname 'people_holding_hands::skin-tone-2-4' and unified '\u{D83E}\u{DDD1}\u{D83C}\u{DFFB}\u{200D}\u{D83E}\u{DD1D}\u{200D}\u{D83E}\u{DDD1}\u{D83C}\u{DFFD}'
Error converting emoji with shortname 'people_holding_hands::skin-tone-2-5' and unified '\u{D83E}\u{DDD1}\u{D83C}\u{DFFB}\u{200D}\u{D83E}\u{DD1D}\u{200D}\u{D83E}\u{DDD1}\u{D83C}\u{DFFE}'
Error converting emoji with shortname 'people_holding_hands::skin-tone-2-6' and unified '\u{D83E}\u{DDD1}\u{D83C}\u{DFFB}\u{200D}\u{D83E}\u{DD1D}\u{200D}\u{D83E}\u{DDD1}\u{D83C}\u{DFFF}'

The full list of failing emojis is here: failing_emoji_variations.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant