FAQ
Vue warn: Failed setting prop
[Vue warn]: Failed setting prop "prefix" on <component-stub>: value foo is invalid.
TypeError: Cannot set property prefix of #<Element> which has only a getter
This warning is shown in case you are using shallowMount or stubs with a property name that is shared with Element.
Common property names that are shared with Element:
attributeschildrenprefix
See: https://developer.mozilla.org/en-US/docs/Web/API/Element
Possible solutions
- Use
mountinstead ofshallowMountto render without stubs - Ignore the warning by mocking
console.warn - Rename the prop to not clash with
Elementproperties