Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

DX: The type of the ui-kit component could not be resolved. #230

Open
Jannchie opened this issue Sep 11, 2023 · 2 comments · May be fixed by #231
Open

DX: The type of the ui-kit component could not be resolved. #230

Jannchie opened this issue Sep 11, 2023 · 2 comments · May be fixed by #231

Comments

@Jannchie
Copy link
Contributor

Jannchie commented Sep 11, 2023

I am learning the monorepo architecture of this library.
I found that components in the ui-kit are resolved to any type.

I found that this could be caused by the exports field in ui-kit's package.json (delete this field and add /dist/ in the path in the resolver.ts will work).

I'm still learning and haven't found a solution yet. I've posed an issue(vitejs/vite-plugin-vue#252) for the moment, but wondered if you have an elegant solution?

@Jannchie Jannchie linked a pull request Sep 11, 2023 that will close this issue
@alexzhang1030
Copy link
Collaborator

Commonly we do not care about these, because we use unplugin-vue-components to auto change/add the import path in
compile time.

see this

@Jannchie
Copy link
Contributor Author

Jannchie commented Sep 11, 2023

Commonly we do not care about these, because we use unplugin-vue-components to auto change/add the import path in
compile time.

While this generates the type definition file correctly, it doesn't resolve to the vue file correctly.
This leads to missing type definitions at development time, even though the components can be imported.

The solution is that the consumer needs to define the paths alias in tsconfig.json.

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

Successfully merging a pull request may close this issue.

2 participants