From c38b8c13caf8a14bbe8d9d9306356f869ca58df2 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 27 Dec 2022 21:56:43 +0100 Subject: [PATCH] fix: ssr for emojis --- composables/setups.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/composables/setups.ts b/composables/setups.ts index 9ea239e7..db0b0664 100644 --- a/composables/setups.ts +++ b/composables/setups.ts @@ -76,9 +76,11 @@ export async function setupI18n() { } export async function setupEmojis() { - const promise = import('@emoji-mart/data').then(r => r.default) - const { init } = await import('emoji-mart') - init({ - data: () => promise, - }) + if (process.client) { + const promise = import('@emoji-mart/data').then(r => r.default) + const { init } = await import('emoji-mart') + init({ + data: () => promise, + }) + } }