unplugin-vue-components icon indicating copy to clipboard operation
unplugin-vue-components copied to clipboard

components.d.ts it looks does not work

Open 810505339 opened this issue 2 years ago • 8 comments

Describe the bug

image

components.d.ts 

components.d.ts it looks does not work

Reproduction

https://github.com/810505339/electron-vite-vue-uncoss

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 Intel(R) Core(TM) i9-10900T CPU @ 1.90GHz
    Memory: 20.43 GB / 31.72 GB
  Binaries:
    Node: 14.19.0 - ~\AppData\Roaming\nvm\nodejs\node.EXE
    npm: 6.14.15 - ~\AppData\Roaming\nvm\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.963.0), Chromium (109.0.1518.70), ChromiumDev (111.0.1660.12)
    Internet Explorer: 11.0.22621.1

Used Package Manager

pnpm

Validations

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

810505339 avatar Mar 02 '23 08:03 810505339

its good with me, try reload your ide

image

lishaobos avatar Mar 08 '23 08:03 lishaobos

它对我很好,请尝试重新加载您的 IDE

image

because i add pnpm i -D @vue/runtime-core It worked for me

810505339 avatar Mar 08 '23 09:03 810505339

我也遇到了这个问题,使用pnpm运行时无法检测到自动引入的element-plus组件的类型,但是npm和yarn都可以做的。查询后有一种观点觉得比较正确,文章链接:https://juejin.cn/post/7189812753366777915。但是他的解决方式对我当前的版本好像并没有效果,所以还是得用回yarn/npm

INCORRENTs avatar Mar 12 '23 03:03 INCORRENTs

我也遇到了这个问题,使用pnpm运行时无法检测到自动引入的element-plus组件的类型,但是npm和yarn都可以做的。查询后有一种观点觉得比较正确,文章链接:https://juejin.cn/post/7189812753366777915。但是他的解决方式对我当前的版本好像并没有效果,所以还是得用回yarn/npm

你尝试安装了 pnpm i -D @vue/runtime-core 了吗? 我是通过了重新安装修复这个问题的

810505339 avatar Mar 12 '23 04:03 810505339

Actually, just include it。

其实只要包含进去就可以了。

image

image

markthree avatar Mar 13 '23 10:03 markthree

我也遇到了这个问题,使用pnpm运行时无法检测到自动引入的element-plus组件的类型,但是npm和yarn都可以做的。查询后有一种观点觉得比较正确,文章链接:https://juejin.cn/post/7189812753366777915。但是他的解决方式对我当前的版本好像并没有效果,所以还是得用回yarn/npm

他的解决方式对我生效了,根据 pnpm 文档,在项目文件夹下建立 .npmrc 文件,添加一行

public-hoist-pattern[]="@vue/runtime-core"

执行 pnpm i 重新安装依赖。

另外要确保 tsconfig.json 文件的 include 下包括 components.d.ts 文件

{
    // ...
    "includes": ["some/files", "./components.d.ts"]
}

rexcape avatar Mar 20 '23 04:03 rexcape

在 #638 中已修复

ikxin avatar Jun 07 '23 00:06 ikxin

在 #638 中已修复

又引出了新的问题,我的项目中的版本从0.25.0升级到0.25.1后,全局类型失效了

SadWood avatar Jun 07 '23 03:06 SadWood