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.

Vue 2.5.1: Invalid value for option "components": expected an Object, but got Array.

See original GitHub issue

After upgrading to Vue 2.5.1 I receive the following console warning:

vue-bootstrap-warn

Triggered by bootstrap-vue.esm.js:

        // Register components
        for (var component in components) {
            Vue.component(component, components[component]);
        }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:23
  • Comments:31 (12 by maintainers)

github_iconTop GitHub Comments

21reactions
kriomantcommented, Oct 18, 2017

Until fix is released, I worked around it using:

let originalVueComponent = Vue.component
Vue.component = function(name, definition) {
  if (name === 'bFormCheckboxGroup' || name === 'bCheckboxGroup' ||
      name === 'bCheckGroup' || name === 'bFormRadioGroup') {
    definition.components = {bFormCheckbox: definition.components[0]}
  }
  originalVueComponent.apply(this, [name, definition])
}
Vue.use(BootstrapVue)
Vue.component = originalVueComponent
16reactions
lucasmikecommented, Nov 5, 2017

putting together @kriomant and @Flygenring code, here is a complete workaround for Node, works for me on the entire bootstrap-vue import:

let originalVueComponent = Vue.component
Vue.component = function (name, definition) {
  if (Array.isArray(definition.components) && definition.components.length === 1) {
    definition.components = {[name]: definition.components[0]}
  }
  originalVueComponent.apply(this, [name, definition])
}

Vue.use(BootstrapVue)
Vue.component = originalVueComponent
Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid warning "Invalid value for option components" - Get Help
It works fine, but in the console I get the following warning: [Vue warn]: Invalid value for option "components": expected an Object, but...
Read more >
[Vue warn]: Invalid prop: type check failed for prop "value ...
I have an input with the type number, ...
Read more >
type check failed for prop "value". expected array, got object ...
I'm receiving the following error: [Vue warn]: Invalid prop: type check failed for prop "value". Expected Object, got Number. @Component({ ...
Read more >
Creating a GraphQL Client With the Vue.js Framework
... bug that causes an error ( Invalid value for option "components": expected an Object, but got Array ) on the 2.5.x version...
Read more >
Forms - Vue Formulate
You can read and write to form values using v-model just as you would on an ... are passed an object of the...
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