unplugin / unplugin-icons

🤹 Access thousands of icons as components on-demand universally.
https://www.npmjs.com/package/unplugin-icons
MIT License
3.65k stars 131 forks source link

Qwik type definitions are not exported in package.json #349

Closed totto2727 closed 4 months ago

totto2727 commented 4 months ago

Describe the bug

I searched Qwik and confirmed that there is no corresponding Issue.

Currently, there is no export of the Qwik type definition file in package.json. This causes an error when configuring tsconfig.json according to the documentation, as it does not recognize the type definition file.

". /node_modules/unplugin-icons/types/qwik" will work properly, so it is almost certainly a misconfiguration in package.json.

If you add the following to the exports field in package.json, it should work correctly with the configuration as documented.

    "./types/qwik": {
      "types": "./types/qwik.d.ts"
    }

Issue before submitting the PR.

Should I submit a PR on my end?

Rerated PR

https://github.com/unplugin/unplugin-icons/pull/262/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

Reproduction

https://stackblitz.com/edit/vitejs-vite-uv7rug?file=package.json

System Info

❯ npm run build

> vite-qwik@0.0.0 build
> tsc && vite build

error TS2688: Cannot find type definition file for 'unplugin-icons/types/qwik'.
  The file is in the program because:
    Entry point of type library 'unplugin-icons/types/qwik' specified in compilerOptions

  tsconfig.json:24:15
    24     "types": ["unplugin-icons/types/qwik"]
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File is entry point of type library specified here.

Found 1 error.

Used Package Manager

npm

Validations

stackblitz[bot] commented 4 months ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.