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

[Bug Report] [TypeScript] [time-select] Use the "vue-tsc" command to check ts and report an error: "Cannot find name 'ComponentSize'. type: import("vue").PropType<ComponentSize>;", without "{skipLibCheck: true}" in "tsconfig.ts" #7265

Closed
363797271 opened this issue Apr 20, 2022 · 4 comments
Labels
has workaround Quality::TypeScript Related this issue is related to type definition

Comments

@363797271
Copy link

Bug Type: TypeScript

Environment

  • Vue Version: 3.2.25
  • Element Plus Version: 2.1.8
  • Browser / OS: Microsoft Edge 100.0.1185.44/ Window 10 19044.1586
  • Build Tool: Vite

Reproduction

Related Component

  • el-time-select

Reproduction Link

Element Plus Playground

Steps to reproduce

First of all, the link of reproduction is meaningless. Please ignore it

  1. Vite create Vue application
  2. Use automatic import to import element plus components on demand
  3. run "npm run build"("vue-tsc --noEmit && vite build")

What is Expected?

Run successfully without error

What is actually happening?

node_modules/element-plus/es/components/time-select/index.d.ts:108:38 - error TS2304: Cannot find name 'ComponentSize'.
108         type: import("vue").PropType<ComponentSize>;

node_modules/element-plus/es/components/time-select/index.d.ts:277:38 - error TS2304: Cannot find name 'ComponentSize'.
277         type: import("vue").PropType<ComponentSize>;

node_modules/element-plus/lib/components/time-select/index.d.ts:108:38 - error TS2304: Cannot find name 'ComponentSize'.
108         type: import("vue").PropType<ComponentSize>;

node_modules/element-plus/lib/components/time-select/index.d.ts:277:38 - error TS2304: Cannot find name 'ComponentSize'.
277         type: import("vue").PropType<ComponentSize>;


Found 4 errors in 2 files.

Errors  Files
     2  node_modules/element-plus/es/components/time-select/index.d.ts:108
     2  node_modules/element-plus/lib/components/time-select/index.d.ts:108

Additional comments

I found that the reason is that the node_modules\element-plus\lib\components\time-select\index.d.ts file uses an ComponentSize that was not imported:

type: import("vue").PropType<ComponentSize>;

I found that none of the other components are using it anymore.

At present, I can only temporarily solve this problem by configure {skiplibcheck: true} in tsconfig.ts.

I hope the authorities will find and solve it, or tell me a scientific way

@mollyxfma
Copy link

got same problem

@h3poteto
Copy link

Mee too

h3poteto added a commit to h3poteto/whalebird-desktop that referenced this issue May 28, 2022
Because element-plus 2.1 has a bug regarding typecheck.
I'm waiting for element-plus/element-plus#7265
h3poteto added a commit to h3poteto/whalebird-desktop that referenced this issue May 28, 2022
Because element-plus 2.1 has a bug regarding typecheck.
I'm waiting for element-plus/element-plus#7265
@sxzz sxzz added need reproduction Need more information, we cannot reproduce your problem Quality::TypeScript Related this issue is related to type definition labels Jun 1, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot closed this as completed Jun 4, 2022
@sxzz sxzz added has workaround and removed need reproduction Need more information, we cannot reproduce your problem labels Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has workaround Quality::TypeScript Related this issue is related to type definition
Projects
None yet
Development

No branches or pull requests

4 participants