Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

floreap's avatar

Set() object cannot read properties of undefined with Vue3

There's a single post with id 1.

  <div v-if="isChatVisible(1)"  >
      <Chat />
   </div>
export default {
    data() {
        return {
            visibileChats: new Set(), 
        };
    },
    methods: {
        isChatVisible(postId) {
            return this.visibleChats.has(postId); 
        },

I get : TypeError: Cannot read properties of undefined (reading 'has').

Later edit and solved! There was a typo: visibleChats and not visibileChats.

0 likes
0 replies

Please or to participate in this conversation.