Vue requires that type imports be explicit (so that the Vue compiler can correctly optimise and resolve type imports for props and so on). See core Vue tsconfig.json.
We’ve therefore taken the decision to turn on verbatimModuleSyntax by default in Nuxt projects, which will throw a type error if types are imported without an explicit type import. To resolve it you will need to update your imports:
https://nuxt.com/blog/v3-8#type-import-changes
Nuxt
Nuxt 3.8 · Nuxt BlogNuxt 3.8 is out, bringing built-in DevTools, automatic Nuxt Image install, a new app manifest and much more.
本記事を見られている方は、恐らく型エラーが出るようになっていると思います。
'RecipeEntity' is a type and must be imported using a type-only
import when 'verbatimModuleSyntax' is enabled.
目次
対処方法
方法1:typeをつけるなど型を厳密にする
import { RecipeEntity } from "~~/types/entities";
↓
import { type RecipeEntity } from "~~/types/entities";
コメント