-
Notifications
You must be signed in to change notification settings - Fork 884
Open
Description
I've encountered an issue when using emoji-mart v5.5.1, and I’d like to clarify certain points regarding locale file handling and share my experience for future reference.
problem
- At some point, the emoji-picker menu was empty.
- I found that the request to kr.json from the CDN failed with 404 error, and that was the cause.
- I realized that
kr.jsonin the emoji-mart/data package is nowko.json. - The relevant fetch code is written in a way that forces the use of the latest version on the CDN (@latest), regardless of the library version in use.
I18n =
(typeof props.i18n === 'function' ? await props.i18n() : props.i18n) ||
(locale == 'en'
? i18n_en
: await fetchJSON(
`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${locale}.json`, // latest version: kr.json not exists
))
- Since I'm using v5.5.1(the locale option is still 'kr'), the application tries fetching kr.json, which no longer exists. Changing the locale value to ko is not a viable workaround. because v5.5.1 does not recognize it and simply falls back to the default value, 'en'.
- So, I copied
kr.jsonfrom the repository and pass it directly usingi18nprop.
My Questions
- Why does the picker component always fetch locale files from the latest version on the CDN, instead of matching the version of the library in use? Doesn't this inevitably cause version mismatch issues, especially when locale file names or contents change?
- Are there alternative solutions to handle this type of issue besides quickly upgrading, or serving custom static assets? Did I miss any recommended way to handle missing/renamed locales when pinned to an older library version?
Thank you for your hard work and for any input on this topic.
Metadata
Metadata
Assignees
Labels
No labels