Veturで"Type annotations can only be used in TypeScript files."が出る場合


TypeScript化したVue.jsプロジェクトに過去のVue.jsプロジェクトからコンポーネントを移植してTS化していた際、VeturがType annotations can only be used in TypeScript files.とエラーを出して型定義をさせてくれませんでした。

原因

凡ミス中の凡ミスですが、原因は<script>タグに<script lang="ts">と記載していないことでした。

参考

Couldn't resolve 'types' can only be used in a .ts file. Vetur(8010) #1347