3rd-party components with "Layout" in the name generate incorrect import paths in `components.d.ts`
rsek opened this issue ยท 2 comments
rsek commented
- I have read the [troubleshooting section] before opening an issue.
- I have tried upgrading
iles
andvite
.
Description ๐
So far I've been able to reproduce this with both Vuetify (VLayout
) and Inkline (ILayout
). This is with the appropriate resolvers (Vuetify3Resolver
, InklineResolver
) from unplugin-vue-components/resolvers
.
// iles.config.ts
import { defineConfig } from 'iles'
import { Vuetify3Resolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
vite: {
ssr: { noExternal: ['vuetify'] }
},
components: {
dirs: ['src/components', 'node_modules/vuetify'],
resolvers: [Vuetify3Resolver()]
}
})
// components.d.ts
declare module '@vue/runtime-core' {
export interface GlobalComponents {
// ...
VLayout: typeof import('./src/layouts/v.vue')['default'] // expected: typeof import('vuetify/components')['VLayout']
// ...
VList: typeof import('vuetify/components')['VList']
VListItem: typeof import('vuetify/components')['VListItem']
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
}
}
Reproduction ๐
Available here. This reproduces it with Vuetify, but the same pattern is apparent with Inkline's ILayout
, where it points to src/layouts/i.vue
instead of src/layouts/v.vue
.
Dependencies Info
Run npx iles info
and pnpm list
(or npm list
) and provide the output:
npx iles info
: iles v0.9.2 vite v4.1.4
npm list
:
iles-layout-bug@0.0.0 /home/rsek/Development/GitHub/iles-layout-bug-repro
โโโ iles@0.9.2
โโโ npm@9.5.1
โโโ sass@1.58.3
โโโ typescript@4.9.5
โโโ vite@4.1.4
โโโ vue-tsc@0.38.9
โโโ vuetify@3.1.6
ElMassimo commented
Thanks for reporting @rsek, and for providing a minimal reproduction!
Fixed in iles@0.9.4
.
rsek commented
Great, thanks for the fix! :) ๐