Comments (11)
Seems like a typescript issue to me (tsconfig.json).
from language-tools.
Seems like a typescript issue to me (tsconfig.json).
I tried updating typescript in a project created with npm create [email protected]. Library types work.
But don't work with npm create vue@latest where tsconfig is different from tsconfig which is created in npm create with [email protected] tsconfig
Have you tried building a simple library with typescript types on the latest version of Vue?
from language-tools.
I copied the tsconfig files i used to work with building an UI lib. Also you don't have to pass --build
to build, I think it will build the references first. But your references seems only for development, e.g. testing and vite config file.
Here: FanilZarip/test-lib-build@lib_build_with_dts...RayGuo-ergou:test-lib-build:lib_build_with_dts
from language-tools.
I copied the tsconfig files i used to work with building an UI lib. Also you don't have to pass
--build
to build, I think it will build the references first. But your references seems only for development, e.g. testing and vite config file.Here: FanilZarip/test-lib-build@lib_build_with_dts...RayGuo-ergou:test-lib-build:lib_build_with_dts
Hi!
I've created a library with your configs and trying to use it in a new Vue project. But there are still type errors when using it.
My repo with test library. I pack it with npm pack and install locally from /src/local_repo
https://github.com/FanilZarip/test_use_own_library
And type errors screen.
from language-tools.
You are building with --build again. You should understand how it and tsconfig references works first.
I also recommend you to start a new project with vite create.
from language-tools.
You are building with --build again. You should understand how it and tsconfig references works first.
I also recommend you to start a new project with vite create.
Here I build it with your tsconfig and pack with npm pack
https://github.com/FanilZarip/test-lib-build/tree/lib_build_with_dts
Then (github link below) I use this npm package and run type checking and language-tools do not show types. I create vue project with vuejs recommended way. npm create vue@latest. It is clear project with ts. And i wait that config will run well from box.
Also if I run just vue-tsc --watch, yes it is do not show any type errors. But if i use uncorrect props value type it also do not show type error. In my screen I use BaseButton with type="out" instead of "outline" and vscode and vue-tsc do not show errors for types
https://github.com/FanilZarip/test_use_own_library/tree/test_own_lib
Yes I am beginner at TS and Library building.
from language-tools.
I wait correct types "primary" | "outline"
from language-tools.
Not really sure what you mean but all working fine on my side. ( I also used pnpm create vue@latest
to create the project)
Maybe you missed this, in your ui lib's package.json. You need to declare where the type file is.
"exports": {
".": {
+ "types": "./dist/types/index.d.ts",
"import": "./dist/testui.es.ts",
"require": "./dist/testui.umd.ts"
},
"./styles": "./dist/style.css"
},
from language-tools.
also tried your repo, works fine, guessing you just missed that part.
see: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html
for more information.
from language-tools.
also tried your repo, works fine, guessing you just missed that part. see: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html for more information.
Yes, You are right. It was vite-plugin-dts problem with default tsconfig
Thanks!
from language-tools.
vite-plugin-dts error explained here
from language-tools.
Related Issues (20)
- No template class links when `experimentalResolveStyleCssClasses` is set to `always`
- 2.0.17 vue-tsc error - multiple event properties with different modifiers returns TS1117: An object literal cannot have multiple properties with the same name HOT 2
- Every time I create a vue file, it just won't work properly
- The code style is abnormal. HOT 1
- vue-tsc 2.0.18: Property 'xyz' does not exist on type 'abc' when using v-for HOT 5
- Event listeners type issues after upgrade `'($event: any) => void' is not assignable to type '() => any'` HOT 1
- 升级到 2.0.18后在组件上使用 v-for 会导致 style等部分属性报 ts类型错误 HOT 2
- 编译崩溃 HOT 1
- 开发微信小程序,view标签会类型错误提示 HOT 2
- Type assertions in setup are not narrowed in template
- How to comment tempalte code with <!-- --> ,not {{/* */}}? HOT 1
- Vue - Official v2.0.19 Cannot automatically complete @ events, such as click events HOT 3
- Document required node version HOT 1
- High CPU usage
- Why color styling is broken? HOT 4
- Cannot find module '@uni' or its corresponding type declarations. HOT 6
- vue-tsc actual readme HOT 1
- Module `@vue/runtime-core` cannot be reconized by language server HOT 2
- Duplicate intellisense
- Incorrect auto-complete for tag-like string in template literals
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language-tools.