Skip to content

[Bug Report] "$attrs is readonly" and "$listeners is readonly" console messages. #4068

Answered by KaelWD
appurist asked this question in General
Discussion options

You must be logged in to vote

There seems to be some confusion around this as it can be caused by a few unrelated things:

Unit testing

We use Vue.extend in our components, so the vuetify plugin must be installed globally to work properly.

Incorrect:

import Vuetify from 'vuetify'
import { mount, createLocalVue } from '@vue/test-utils'
import component from './my-component.vue'

const localVue = createLocalVue()

localVue.use(Vuetify)

describe('module', () => {
  let vuetify
  beforeEach(() => {
    vuetify = new Vuetify()
  })

  it('should do something', () => {
    const wrapper = mount(component, {
      localVue,
      vuetify
    })
  })
})

Correct:

import Vue from 'vue'
import Vuetify from 'vuetify'
import { mount,

Replies: 122 comments 18 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@vegerot
Comment options

@vegerot
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Phancie
Comment options

@mirikerstein
Comment options

@VIXI0
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@yangfei2013
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@vegerot
Comment options

@plweil
Comment options

@sidouglas
Comment options

@glennpjones
Comment options

@jansen-imagem
Comment options

Answer selected by KaelWD
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jefraroce
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@lukicenturi
Comment options

@souljorje
Comment options

@kimbaudi
Comment options

@jellehak
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #4068 on June 11, 2020 07:14.