milesj / emojibase

🎮 A collection of lightweight, up-to-date, pre-generated, specification compliant, localized emoji JSON datasets, regex patterns, and more.
https://emojibase.dev
MIT License
465 stars 38 forks source link

Error fetching emojis: Error: Failed to load Emojibase dataset. #168

Closed shinokada closed 3 months ago

shinokada commented 8 months ago

I'm just trying out emojibase. According to the doc,

Fetches and returns a localized list of emojis (and optional shortcodes) from our CDN. Uses fetchFromCDN and fetchShortcodes under the hood.

I have the following but I get Error fetching emojis error. Can you point out what I am doing wrong?

import { fetchEmojis } from 'emojibase';

async function getEmojis() {
  try {
    const emojis = await fetchEmojis('ja', {
      compact: true,
      shortcodes: ['cldr'],
      version: '2.1.3',
    });

    // Do something with the emojis
    console.log(emojis);
  } catch (error) {
    // Handle errors
    console.error('Error fetching emojis:', error);
  }
}

// Call the async function
getEmojis();
milesj commented 8 months ago

@shinokada What's the http status being returned?

shinokada commented 8 months ago

image

https://stackblitz.com/edit/js-t7pcbe?file=index.js

milesj commented 8 months ago

@shinokada 2.1.3 is extremely old, is there a reason you are using that? Try 15.3.0.