Fix importing emoji loader statically inside worker (#38541)

This commit is contained in:
Echo authored and GitHub committed 2026-04-07 13:17:07 +00:00
1 parent 31d2885d95
commit 8e212fca59
2 files changed
+7 -3

No files matched your search

@@ -1,4 +1,9 @@
import { EMOJI_DB_NAME_SHORTCODES, EMOJI_TYPE_CUSTOM } from './constants';
import {
importCustomEmojiData,
importEmojiData,
importLegacyShortcodes,
} from './loader';
addEventListener('message', handleMessage);
self.postMessage('ready'); // After the worker is ready, notify the main thread
@@ -11,8 +16,6 @@ function handleMessage(event: MessageEvent<{ locale: string }>) {
}
async function loadData(locale: string) {
const { importCustomEmojiData, importEmojiData, importLegacyShortcodes } =
await import('./loader');
let importCount: number | undefined;
if (locale === EMOJI_TYPE_CUSTOM) {
importCount = (await importCustomEmojiData())?.length;