Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read properties of undefined (reading 'allCategories') #250

Open
leonwisdom opened this issue Nov 18, 2022 · 3 comments
Labels
details needed Not enough details to fix the issue, see https://stackoverflow.com/help/minimal-reproducible-example

Comments

@leonwisdom
Copy link

I am using Vue 3 with the Composition API and following the documentation but i am running into an error.
Screenshot 2022-11-18 at 17 10 50
Any help would be greatly appreciated, thank you

@serebrov
Copy link
Owner

@leonwisdom Could you provide an example of the code that reproduces the error?

@leonwisdom
Copy link
Author

leonwisdom commented Dec 10, 2022

@serebrov My apologies for the late reply, i have recently got back from holiday.

Here is the code, the css file is imported globally:

<template>
  <Picker v-if="emojiPickerSelected" :data="emojiIndex"
      title="Pick your emoji…" emoji="point_up" @select="convertEmoji"
  />
</template>
  
<script>
import { ref } from "vue";
import { Picker, EmojiIndex } from "emoji-mart-vue-fast/src";
import data from "emoji-mart-vue-fast/data/all.json";

export default {
  name: "EmojiPicker",
  components: {
    Picker
  },
  emits: ["updateEmoji"],
  setup(props, context) {
    const emojiPickerSelected = ref(false);
    let emojiIndex = new EmojiIndex(data);

    const toggle = () => {
      emojiPickerSelected.value = !emojiPickerSelected.value;
    }

    const convertEmoji = (emoji) => {
      context.emit("updateEmoji", emoji.native);
    }

    return {
      emojiPickerSelected,
      emojiIndex,
      toggle,
      convertEmoji,
    };
  }
};
</script>

Thank you for looking into this, i have followed the instructions on how to use and setup. here are the versions i am using:
Vue - 3.2.45
emoji-mart-vue-fast - 12.0.1

@serebrov
Copy link
Owner

@leonwisdom I am still not able to reproduce the error. I added your example into the Vue 3 demo project, but it works fine - no error:

Screenshot 2022-12-11 at 23 10 42

Live demo is here: https://serebrov.github.io/emoji-mart-vue3-demo/

@serebrov serebrov mentioned this issue Jan 6, 2023
@serebrov serebrov added the details needed Not enough details to fix the issue, see https://stackoverflow.com/help/minimal-reproducible-example label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
details needed Not enough details to fix the issue, see https://stackoverflow.com/help/minimal-reproducible-example
Projects
None yet
Development

No branches or pull requests

2 participants