Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

components.d.ts it looks does not work #608

Open
5 tasks done
810505339 opened this issue Mar 2, 2023 · 8 comments
Open
5 tasks done

components.d.ts it looks does not work #608

810505339 opened this issue Mar 2, 2023 · 8 comments

Comments

@810505339
Copy link

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

  • 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.
@lishaobos
Copy link
Contributor

its good with me, try reload your ide

image

@810505339
Copy link
Author

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

image

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

@INCORRENTs
Copy link

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

@810505339
Copy link
Author

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

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

@markthree
Copy link
Contributor

Actually, just include it。

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

image

image

@rexcape
Copy link

rexcape commented Mar 20, 2023

我也遇到了这个问题,使用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"]
}

@ikxin
Copy link

ikxin commented Jun 7, 2023

#638 中已修复

@SadWood
Copy link
Contributor

SadWood commented Jun 7, 2023

#638 中已修复

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants