question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'includes' of undefined

See original GitHub issue

I am trying to solve this error I keep getting with vue-multiselect 2.0:

vue-multiselect.min.js?6cfa:1 Uncaught TypeError: Cannot read property ‘includes’ of undefined

I have no idea what that means.

data: function () {
    return {
      localOptions: [{ name: 'Test' }, { name: 'Foo' }, { name: 'Bar' }]
    }
}

<multiselect
          :options="localOptions"
          :label="name"
          :selected=""
          :searchable="true"
          @update="updateSelected"
          @close="blur">
</multiselect>

What am I missing here?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
shentaocommented, Sep 14, 2016

If you use the : before the prop-name, it is looking for a property in the component. In this case you want to just pass the name string. Thus you should do track-by="name" instead of :track-by="name".

<multiselect
          class="form-control textarea" 
          :class="{ 'has-error': showError }"
          :options="options"
          track-by="name" // change here
          label="name"
          :placeholder="placeholder" 
          :loading="loading"
          @update="updateSelected"
          @close="blur">
</multiselect>
1reaction
shentaocommented, Sep 14, 2016

Exactly! Glad I could help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'includes' of Undefined in JavaScript
The "Cannot read property 'includes' of undefined" error occurs when calling the includes() method on an undefined value. To solve the error, make...
Read more >
JavaScript error: Cannot read property 'includes' of undefined
It's telling you that you're trying to access a property on an undefined object. The msgArr object doesn't have a property objectID at...
Read more >
Cannot read property 'includes' of undefined #1474 - GitHub
Hi, we use got in many microservice and yesterday we upgrade v11.5.2 to v11.7.0. Since this upgrade we have some error. RequestError: Cannot...
Read more >
Cannot read property 'includes' of undefined : r/learnjavascript
Problem: Uncaught TypeError: Cannot read property 'includes' of undefined. Hi there, I'm having an issue with my script. It shows this:.
Read more >
cannot read properties of undefined (reading 'includes'
If the element at index 0 contains the innerHTML property, our if block will run, otherwise the else block is run. To solve...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found