The knowledge sources don’t mention this specific issue with default imports in <script setup> not being recognized in the template type context, so I can’t confirm an official fix or workaround from Nuxt.
From what is available:
- There are recent changes around auto‑imports and shared type contexts (e.g.
nuxt.shared.d.ts, types/shared.d.ts) that were made to fix missing type definitions for auto‑imports in the shared/ directory, but these deal with Nuxt’s auto‑import system, not with explicit import foo from './x' in SFCs.[shared auto-imports]
- Other linked issues and PRs in the provided context are about path aliases, test files, template import resolution, or HMR, and none describe or fix the exact “default import not visible in template” problem you’re seeing.[template imports]
Because of that, I don’t have a Nuxt‑documented solution to point you to. Based on the sources:
- This looks like a regression or limitation in the current type generation / Volar integration rather than intended behavior, but the knowledge sources don’t show an issue or PR tracking it.
- There’s no documented config flag or hook in the provided material that would specifically fix default imports in templates.
Given the constraints of the knowledge I have, the only concrete suggestion I can make (grounded in the sources) is:
- Ensure you’re on the latest Nuxt version, since several type‑related regressions have been fixed recently (e.g. around shared imports and tsconfig/typecheck mismatches).[shared auto-imports]
- If the problem persists, it likely needs to be reported (or may already be tracked) as a new issue, since nothing in the provided issues/PRs matches your reproduction.