5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vue.jsのテストをする際に起きる「TypeError: Cannot read property '$scopedSlots' of undefined」エラーの回避方法

Posted at

TypeError: Cannot read property '$scopedSlots' of undefined

shallowMount を使ってテストしていたところを、子コンポーネントも見る必要が出てきて mount に変更しました。

しかし、

TypeError: Cannot read property '$scopedSlots' of undefined

と出てしまいます。

ググってみたところ、どうやら sync オプションが原因だったようです。
ウォッチャーを使っていると起きるみたいです。

下記のように syncfalse にすることで回避されました。

mount(component、{sync : false })
5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?