Skip to content

Auto imports don't work in the script setup template without the options API #507

@isabolic

Description

@isabolic

Describe the bug

Auto imports don't work in the script setup template without the options API, I am guessing that this is because export default

Vue components are not registered inside auto-imports.d.ts without export default defineComponent({});

example is in here

CompA is registered while CompB is not

also sometimes you need to restart vite server after adding/removing export default defineComponent({});

Reproduction

https://stackblitz.com/edit/vitejs-vite-wb25xu

System Info

System:
    OS: macOS 14.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 90.45 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
    pnpm: 9.1.0 - ~/.nvm/versions/node/v18.12.1/bin/pnpm
  Browsers:
    Brave Browser: 124.1.65.133
    Chrome: 125.0.6422.113
    Edge: 125.0.2535.79
    Safari: 17.4
    Safari Technology Preview: 17.4

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy