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.

b-table: The computed property "fields" is already defined in data.

See original GitHub issue

When using the b-table component, I get the following error messages:

The computed property "fields" is already defined in data.
``
and sometimes:

The computed property “fields” is already defined as a prop.


sometimes both. 

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

75reactions
jpictoncommented, Nov 2, 2017

This could also be caused by a third-party plugin that sets a global mixin containing a fields data/prop/computed value.

For example, vee-validate adds a fields computed value in a global mixin (I encountered this exact issue when using both bootstrap-vue and vee-validate). Luckily vee-validate allows you to rename this computed value (I assume to avoid this kind of conflict).

63reactions
phitran35commented, Dec 27, 2017

Thank you @JakePicton and @tmorehouse for the solutions. I followed @tmorehouse’s guideline to stop lee-validate’s injection into all components as bellow:

Vue.use(VeeValidate, { inject: 'false' });

Unfortunately, VueJs would throw error message like this: “Property or method “errors” is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property”

Instead, change the Vee fields from configuration and it should work

Vue.use(VeeValidate, { fieldsBagName: 'veeFields' });
Read more comments on GitHub >

github_iconTop Results From Across the Web

The computed property "counter" is already defined in data
When I click on the button, the counter should double the number of clicks displayed, but it's not working. This code is working...
Read more >
The computed property "fields" is already defined in data.
It is written like this. import Vue from 'vue'; import VeeValidate from 'vee-validate'; const config = { errorBagName: 'errors',//change if property conflicts.
Read more >
Computed Properties - Vue.js
Here we have declared a computed property publishedBooksMessage . Try to change the value of the books array in the application data and...
Read more >
Using Vue computed properties - Learn web development
To create a computed property, we need to add a computed property to our component object, much like the methods property we've used...
Read more >
Vue warn]: Computed property "axios" is already defined in ...
Coding example for the question [Vue warn]: Computed property "axios" is already defined in Data. at -Vue.js.
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