Compatible with tsconfig allowArbitraryExtensions
option
#13295
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
scope: compiler
Vue version
3.5.13
Link to minimal reproduction
https://github.com/Teages/vue-allow-arbitrary-extensions
Steps to reproduce
tsconfig.json
WithType.vue
,WithType.d.vue.ts
, add a type export inWithType.d.vue.ts
import type { X } from './WithType.vue'
You can run
pnpm i & pnpm play
in the reproductionWhat is expected?
Vue should load the type from
WithType.d.vue.ts
as allowArbitraryExtensions was enable and.vue
file is not a known JavaScript or TypeScript file extension.What is actually happening?
Vue try to resolve the type from
WithType.vue
but notWithType.d.vue.ts
, and finally it doesn't find the type and throw a error:System Info
Any additional comments?
nuxt/module-builder#597
unjs/mkdist#270
unjs/mkdist#268 (comment)
https://github.com/vuejs/core/blob/v3.5.13/packages/compiler-sfc/src/script/resolveType.ts#L1154
microsoft/TypeScript#50133
I can try to make a pull request to fix it if you want.
The text was updated successfully, but these errors were encountered: