LoginSignup
1
0

More than 5 years have passed since last update.

「[vee-validate] Validating a non-existent field: "". Use "attach()" first.」エラー問題を解決

Last updated at Posted at 2019-05-27

はじめに

VeeValidateを使っているコンポーネントをテストしたかったのですが、下記のようにエラーが吐き出されてしまいます。

[vee-validate] Validating a non-existent field: "#2". Use "attach()" first.

解決方法

テスト対象のコンポーネント側に下記の1行を追記します。


  beforeDestroy() { this.$validator.pause() }

おわりに

この答えにたどり着くまで丸二日間かかりました。
it を複数用意して非同期でテストを実行していたのが原因だったかなと思います。(よくわからないけど)

1
0
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
1
0