nuxt-modules / og-image

Generate OG Images with Vue templates in Nuxt.
https://nuxtseo.com/og-image
400 stars 25 forks source link

Twemoji's CDN is down, breaking emoji support #97

Closed tydeu closed 9 months ago

tydeu commented 11 months ago

Describe the bug

Twemoji's CDN has shut down (twitter/twemoji#580), thus any OG Image which uses emojis in the text will break when twemoji tries to fetch the SVGs for the emojis. There is a new CDN and the old one redirects to it, but the redirect does appear to be followed during prerendering. When twemoji is used directly, this fixable by configuring the twemoji.parse to point to the new CDN (via base). However, nuxt-og-image does not provide a way to configure the parse, so there is no way to fix this without a patch. On the twemoji side, there is a new fork with a new CDN, so another solution is to migrate to the new package.

Reproduction

No response

System / Nuxt Info

No response

harlan-zw commented 11 months ago

Hmm emojis are working fine as far as I've tested, the twemoji dependency uses the latest CDN I thought.

Can you provide some reproduction details?

tydeu commented 11 months ago

@harlan-zw

the twemoji dependency uses the latest CDN I thought.

As far as I can tell, nuxt-og-image depends on final twemoji version 14.0.2, which was release March 30, 2022. The CDN issue was not raised until January 9th, 2023. Thus, I believe nuxt-og-image uses a version with a broken CDN?

https://github.com/harlan-zw/nuxt-og-image/blob/b1e0066438c2c82e2421cae7dceb88bdf79ba6dd/package.json#L72

https://github.com/harlan-zw/nuxt-og-image/blob/b1e0066438c2c82e2421cae7dceb88bdf79ba6dd/pnpm-lock.yaml#L106

harlan-zw commented 11 months ago

So I investigated migrating the package, but it looks like the old CDN actually redirects to the new one.

For example, https://twemoji.maxcdn.com/v/14.0.2/svg/1f44b.svg now points to https://cdn.jsdelivr.net/gh/twitter/twemoji@v14.0.2/assets/svg/1f44b.svg

I'd migrate to @twemoji/api but the types are broken for it.

Do you think we need to do anything?

tydeu commented 11 months ago

@harlan-zw

So I investigated migrating the package, but it looks like the old CDN actually redirects to the new one ... Do you think we need to do anything?

Yes, while the webpage does redirect, at least in my experience, when prerendering the OG images for static site generation (via npm run generate in Nuxt 3), the redirects are not followed, resulting in breakage.

harlan-zw commented 9 months ago

With the v3 release, we completely drop the twemoji dependency which should solve this issue.