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

2.2.2升级后,vue3.5.5 出现ts大面积爆红 #5196

Closed
vastwu1 opened this issue Feb 18, 2025 · 10 comments
Closed

2.2.2升级后,vue3.5.5 出现ts大面积爆红 #5196

vastwu1 opened this issue Feb 18, 2025 · 10 comments

Comments

@vastwu1
Copy link

vastwu1 commented Feb 18, 2025

Vue - Official extension or vue-tsc version

2.2.2

VSCode version

1.97.1

Vue version

3.5.5

TypeScript version

5.3.3

System Info

window

package.json dependencies

{
  ...
  "scripts": {
    "dev": "vite",
    "serve:stg": "vite serve --mode staging",
    "serve:prd": "vite serve --mode production",
    "build:prod": "vite build",
    "build:stage": "vite build --mode staging",
    "preview": "vite preview"
  },
  "dependencies": {
    "@antv/g2": "^5.2.10",
    "@antv/s2": "^2.1.8",
    "@bpmn-io/properties-panel": "^3.25.1",
    "@element-plus/icons-vue": "2.3.1",
    "@vueup/vue-quill": "1.2.0",
    "@vueuse/core": "10.6.1",
    "axios": "0.27.2",
    "bpmn-js": "^18.1.2",
    "bpmn-js-i18n-zh": "^1.1.0",
    "bpmn-js-properties-panel": "^5.21.0",
    "camunda-bpmn-js": "^4.17.0",
    "dayjs": "^1.11.10",
    "echarts": "5.4.3",
    "element-china-area-data": "^6.1.0",
    "element-plus": "^2.8.0",
    "event-source-polyfill": "^1.0.31",
    "file-saver": "2.0.5",
    "fuse.js": "6.6.2",
    "htm": "^3.1.1",
    "js-cookie": "3.0.5",
    "jsencrypt": "3.3.2",
    "jszip": "^3.10.1",
    "lodash-es": "^4.17.21",
    "nprogress": "0.2.0",
    "pdf-lib": "^1.17.1",
    "pinia": "2.1.7",
    "sortablejs": "^1.15.1",
    "splitpanes": "^3.1.8",
    "swrv": "^1.0.4",
    "vue": "^3.5.5",
    "vue-baidu-map-3x": "^1.0.35",
    "vue-cropper": "1.1.1",
    "vue-router": "4.2.5",
    "vuedraggable": "^4.1.0"
  },
  "devDependencies": {
    "@tsconfig/node18": "^18.2.2",
    "@types/event-source-polyfill": "^1.0.5",
    "@types/file-saver": "^2.0.7",
    "@types/js-cookie": "^3.0.6",
    "@types/lodash-es": "^4.17.12",
    "@types/node": "^20.11.24",
    "@types/nprogress": "^0.2.3",
    "@types/sortablejs": "^1.15.8",
    "@types/splitpanes": "^2.2.6",
    "@typescript-eslint/eslint-plugin": "^6.4.0",
    "@vitejs/plugin-vue": "4.5.0",
    "@vitejs/plugin-vue-jsx": "^3.0.2",
    "@vue/compiler-sfc": "3.3.9",
    "@vue/eslint-config-typescript": "^13.0.0",
    "@vue/tsconfig": "^0.4.0",
    "eslint": "^8.57.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-config-standard-with-typescript": "^43.0.1",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "eslint-plugin-promise": "^6.0.0",
    "eslint-plugin-vue": "^9.23.0",
    "less": "^4.2.1",
    "prettier-eslint": "^16.3.0",
    "rollup-plugin-visualizer": "^5.12.0",
    "sass": "1.69.5",
    "typescript": "^5.3.3",
    "unplugin-auto-import": "0.17.1",
    "unplugin-vue-components": "^0.26.0",
    "unplugin-vue-setup-extend-plus": "1.0.0",
    "vite": "^5.0.4",
    "vite-plugin-compression": "0.5.1",
    "vite-plugin-svg-icons": "2.0.1"
  }
}

Steps to reproduce

相应版本下编辑器即可浮现

Image

如果没有引用 ".pnpm/[email protected]/node_modules/vue",则无法命名 "__VLS_37" 的推断类型。这很可能不可移植。需要类型注释。ts-plugin(2742)
如果没有引用 ".pnpm/[email protected]/node_modules/vue/types/v3-component-public-instance",则无法命名 "__VLS_37" 的推断类型。这很可能不可移植。需要类型注释。ts-plugin(2742)
如果没有引用 ".pnpm/[email protected]/node_modules/vue/types/vue",则无法命名 "__VLS_37" 的推断类型。这很可能不可移植。需要类型注释。

What is expected?

不报红

What is actually happening?

ts错误

Link to minimal reproduction

No response

Any additional comments?

No response

@KazariEX
Copy link
Collaborator

Please provide a minimal reproduction.

@vastwu1
Copy link
Author

vastwu1 commented Feb 18, 2025

what

@KazariEX
Copy link
Collaborator

@vastwu1
Copy link
Author

vastwu1 commented Feb 18, 2025

经过我得反复测试 跟这个Splitpanes 插件有关 当我为Splitpanes组件指定ref时,vue版本为3.5.5,插件为2.2.2时可以稳定复现
以下情况会报错:<Splitpanes ref="splitpanesRef" class="flex-form"> <pane></pane> </Splitpanes>
以下情况不会报错:<Splitpanes class="flex-form"> <pane></pane> </Splitpanes>

@KazariEX
Copy link
Collaborator

这个组件是放在 v-if 里的吗,直接放在 template 顶部有没有问题

@ykirshov
Copy link

使用 export type Props {},然后 defineProps();
这将对你有效,现在你应该导出你的 props

@vastwu1
Copy link
Author

vastwu1 commented Feb 19, 2025

splitpanes是一个第三方库 https://antoniandre.github.io/splitpanes/

@KazariEX
Copy link
Collaborator

麻烦提供一个最小复现片段。

@zcf0508
Copy link
Contributor

zcf0508 commented Feb 19, 2025

可能是 vue3 使用 @types/splitpanes 导致的。

尝试移除依赖后手动添加声明

antoniandre/splitpanes#144 (comment)

@KazariEX
Copy link
Collaborator

I think this issue is likely a variant of #5186 that has been fixed. Will close it unless there is new evidence indicating that these are two different issues.

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

No branches or pull requests

4 participants