Skip to content

components.d.ts path error if the name startswith prefix defined in collections #326

Description

@genffy

Describe the bug

When use ViteComponents and IconsResolver, and if the component name include the string that is defined in colloections(default is icon-sets.json), and the components.d.ts file will get error path.

eg:
LayoutHeader => LayoutHeader: typeof import('~icons/la/yout-header')['default']
Circle: typeof import('~icons/ci/rcle')['default']
Because the la and ci are all both included by icon-sets prefix

The mini reproduction is a nuxt3 example.

Reproduction

https://stackblitz.com/edit/nuxt-starter-mrqmcy?file=components.d.ts

System Info

System:
    OS: macOS 14.0
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Memory: 21.04 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
    Yarn: 3.6.1 - ~/.nvm/versions/node/v18.17.0/bin/yarn
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
    pnpm: 8.6.7 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 118.0.5993.117
    Safari: 17.0

Used Package Manager

pnpm

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.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions