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] Cannot find type definition file for 'element-plus/global' #4716
Comments
"compilerOptions": {
- "types": ["element-plus/global"]
}
+ "include": ["node_modules/element-plus/global.d.ts"] |
Template hints have no effect.(TS 4.4.3) |
@tfn290181662 Types file of some components are missing, this is a BUG. link #4531 {
"compilerOptions": {
+ "skipLibCheck": true,
}
}
|
I found a solution. like this https://github.com/vitejs/vite/blob/main/packages/create-vite/template-vue-ts/src/env.d.ts add /// <reference types="element-plus/global" /> but the lastest vscode ts version is 4.5.2,the global componet hints will no effect i have to copy element-plus/global.d.ts code into env.d.ts |
Please refer to https://github.com/element-plus/element-plus-playground . // tsconfig.json
{
"compilerOptions": {
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"module": "ESNext",
"rootDir": ".",
"baseUrl": ".",
"moduleResolution": "node",
"resolveJsonModule": true,
"outDir": "dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": false,
"noUnusedLocals": true,
"skipLibCheck": true,
"types": ["element-plus/global", "vite/client"]
},
"include": ["src/**/*"]
} //package.json
"dependencies": {
"element-plus": "1.2.0-beta.5",
"typescript": "4.5.2",
"vue-tsc": "0.29.8"
} |
I encountered the same problem {
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"allowJs": true,
"sourceMap": true,
"baseUrl": ".",
"types": ["node", "element-plus/global", "vite/client"],
"paths": {
"@/*": ["src/*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx",
"type-css.d.ts",
"src/views/service-repository/components/depend/tree.js"
],
"exclude": ["node_modules"]
}
all components of element-plus have no types. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please upgrade |
it's OK now with ts 4.5.2 👌 |
Element Plus version
1.2.0-beta.5
OS/Browsers version
Windows 10
Vue version
3.2.24
Steps to reproduce
use ts Volar support and auto import
https://element-plus.org/en-US/guide/quickstart.html#full-import
tsconfig.json
then run tsc cli
or vue-tsc at the project
it will show error.
What is Expected?
build success
What is actually happening?
Actually vscode show same error at tsconfig.json
i have to create a
tsconfig.prod.json
and then run
vue-tsc --noEmit --project tsconfig.prod.json
It can run successful.
The text was updated successfully, but these errors were encountered: