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

如果 Volar 版本号高于 2.0.12,uni-app 自带的标签类型定义会报错 #64

Closed
4 tasks done
VxRain opened this issue May 18, 2024 · 2 comments
Closed
4 tasks done

Comments

@VxRain
Copy link

VxRain commented May 18, 2024

描述问题

如果 Volar 版本号高于 2.0.12,uni-app 自带的标签类型定义会报错
我是在使用uni-vitesse这个模板创建项目时发现问题的

button标签报错的截图:
button标签报错

目前发现绝大部分自带标签都会报错,目前找到的共性是,它们都是定义在declare module 'vue3/jsx-runtime'

复现

https://github.com/uni-helper/vitesse-uni-apphttps://github.com/Ares-Chang/uni-vitesse 这两个模板项目中都能稳定复现

系统信息

基础环境信息:

  • os: Windows 11 10.0.22631
  • node: 20.13.1
  • vscode: 1.89.1
  • volar: 2.0.19

基础依赖信息:

  • vue: 3.4.21
  • vite: 4.0.3
  • @dcloudio/uni-app: 3.0.0-3090920231225001

uni-helper依赖信息:

  • @uni-helper/eslint-config: 0.0.6
    • eslint: 8.57.0
  • @uni-helper/uni-app-types: 0.5.12
  • @uni-helper/unocss-preset-uni: 0.2.7
    • unocss: 0.58.5
  • @uni-helper/vite-plugin-uni-layouts: 0.1.7
  • @uni-helper/vite-plugin-uni-pages: 0.2.15

uni-helper插件信息:

  • create-uniapp-view: 2.1.0
  • uni-app-schemas-vscode: 0.9.3
  • uni-app-snippets-vscode: 0.10.2
  • uni-cloud-snippets-vscode: 0.3.0
  • uni-helper-vscode: 0.5.9
  • uni-highlight-vscode: 0.3.10
  • uni-ui-snippets-vscode: 0.6.6

使用的包管理器

pnpm

核对

  • 遵循我们的 行为准则
  • 检查是否已经有一个报告相同错误的问题,以避免重复创建。
  • 这是一个具体的错误。请开启 GitHub 讨论你的疑问。
  • 所提供的复现是这个问题的 最小复现
@VxRain
Copy link
Author

VxRain commented May 18, 2024

看着和之前的 #43 这个情况有点相似

@VxRain
Copy link
Author

VxRain commented May 18, 2024

参考 #63 解决了。

步骤:

  1. 升级uni-app-types到 0.5.13
  2. tsconfig.jsonvueCompilerOptions 中新增 plugins 配置项,如下
  "vueCompilerOptions": {
    "plugins": ["@uni-helper/uni-app-types/volar-plugin"]
  }

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

1 participant