Skip to content

[Docs] auto-import type declarations might not generated in the integration with vue projects #6769

Description

@ParsaJR

Package

v4.x

Description

We know that Nuxt UI uses unplugin-auto-import and unplugin-vue-components vite plugins, which should generate the files:

  • auto-imports.d.ts
  • components.d.ts

on development/production environments.

The problem is that these declaration files are generated by Vite plugins, while the default Vue project boilerplate currently uses the following build setup:

{
  "name": "vue-project",
  "version": "0.0.0",
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "run-p type-check \"build-only {@}\" --",
    "preview": "vite preview",
    "build-only": "vite build",
    "type-check": "vue-tsc --build"
  },
  "dependencies": {
    "vue": "^3.5.40"
  }
}

The build script above runs two processes in parallel : type-checking, vite build process.

This can create a race condition, because vue-tsc can possibly start before the Vite plugins, that have generated the required declaration files.

For example, a clean build may fail with a message like this:

error TS2304: Cannot find name 'useToast'.

This is expected because vue-tsc has no knowledge of the Nuxt UI auto-imports until auto-imports.d.ts has been generated.

I think it worth mentioning in Vue specific docs, as this is the default boilerplate of package.json that many people use.

Additional context

No response

Activity

  1. added
    triageAwaiting initial review and prioritization
    on Jul 23, 2026
  2. coderabbitai commented on Jul 23, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #6595 - feat(vite): add root option to override .nuxt-ui directory location [closed]
    #6635 - feat(unplugin): pre-bundle used icons into the Vue/Vite build [merged]
    #6728 - test: add benchmarks [merged]
    #6731 - feat(vue): support experimental.componentDetection [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. changed the title [-][Docs] auto-import type declarations might not generated in the integration with vue[/-] [+][Docs] auto-import type declarations might not generated in the integration with vue projecrs[/+] on Jul 23, 2026
  4. changed the title [-][Docs] auto-import type declarations might not generated in the integration with vue projecrs[/-] [+][Docs] auto-import type declarations might not generated in the integration with vue projects[/+] on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageAwaiting initial review and prioritization

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions