[@vue/compiler-sfc] Failed to resolve extends base type.

ive consolidated common types within my components and shifted them all to a types folder where they're auto imported. these types are designed to be composable with consuming base types. however when attempting to extend base types i now get this error
If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example:
interface Props extends /* @vue-ignore */ Base {}
Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.
If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example:
interface Props extends /* @vue-ignore */ Base {}
Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.
one of my types looks like the following, where all the extends interfaces are auto imported from the types folder.
export interface FormInputBaseProps extends AriaLabellingProps, AriaValidationProps, FocusableDOMProps { /* specific properties */ }
export interface FormInputBaseProps extends AriaLabellingProps, AriaValidationProps, FocusableDOMProps { /* specific properties */ }
ive uninstalled and reinstalled everything, there's no third party libraries from my side being used in this implementation. surely this has to be a bug. am i honestly expected to add this /* @vue-ignore */ hack to all my extended types?
2 Replies
kapa.ai
kapa.ai4d ago
Hi @BinaryArtifex. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources provided do not contain explicit information about the specific error message:
[@vue/compiler-sfc] Failed to resolve extends base type.
or about issues with extending auto-imported types from a types folder in Nuxt 3, nor do they discuss the requirement to use the /* @vue-ignore / directive in this context. However, there are some related points in the sources: - Nuxt 3 supports TypeScript natively, and you can use .ts files or <script setup lang="ts"> in your components for type safety and auto-imports of composables and components. Type auto-imports are generally supported if you follow the recommended setup for TypeScript and auto-imports in Nuxt 3, as described in the docs and migration guides. You can check .nuxt/types/imports.d.ts to see how Nuxt resolves your auto-imports, but there is no mention of auto-importing types/interfaces specifically or issues with extending them from a types folder in the provided sources Auto Imports Migration. - There is a related issue where auto-imports from the shared/ folder are only supported in Nuxt v4 (or with compatibilityVersion: 4), which may affect how types are resolved if you are using a shared/ directory for your types in Nuxt 3. In Nuxt 3, you may need to manually import types from your types folder, as auto-import for types/interfaces is not guaranteed Github Issue: Shared folder - Autoimports not working. - If you are using layers with their own tsconfig.json, you must run nuxt prepare in each layer to ensure type resolution works correctly, as required by @vitejs/plugin-vue Github Issue: failed to resolve "extends":"./.nuxt/tsconfig.json". Given the above, it appears that auto-importing types/interfaces from a types folder may not be fully supported in Nuxt 3, and you may need to use explicit imports for types you wish to extend. The workaround with / @vue-ignore / is mentioned in your error message, but the knowledge sources do not confirm this as an official or recommended solution. If this is a regression from a previous Nuxt version, or if you believe it is a bug, you may want to open an issue on the Nuxt GitHub repository with a minimal reproduction. Summary:
The knowledge sources do not provide a definitive answer or workaround for this specific error. There is no mention of a requirement to use /
@vue-ignore */ for extended types, nor confirmation that auto-importing types/interfaces from a types folder is fully supported in Nuxt 3. You may need to use explicit imports for types, or follow up with the Nuxt team for further clarification. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4d ago
<@382140070183960576> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?