Riot template error thrown in the <...> tag
タグ内で自身のデータにアクセスしようとした時に下記エラーが出るようになりました。
> Riot template error thrown in the <...> tag
ソースではカスタムタグ内でdata.hoge
のようにオブジェクトのプロパティにアクセスしようとしていました。
<custom-tag>
<h1>This is Riot 3.0</h1>
<p>Show console, you check error <span style="color:red;">"Riot template error thrown in the <...> tag".<span></p>
<p>{data.hoge}</p>
</custom-tag>
2.0ではエラーが出ない
サンプル(codepen)
3.0ではエラーが出る
サンプル(codepen)
No update and updated events triggered before the mount
が関係しているのかな…
色々試行錯誤していくと、mountされる前にちゃんとupdate
でデータを入れてやるとエラーは解消されました。
移行ガイドには、
No update and updated events triggered before the mount
と記載されているので、おそらくmountイベントの前にはupdate
が走らないようになったのが関係しているのかなと。