Closed Y0me closed 1 year ago
Currently this is causing me the same issues as well, I believe it's same issue as described as above, only experiencing it with jest however. Wrapping the interface with another interface seems to fix the issue, however that'll change the way you need to interact with the component by quite a bit.
defineProps<{props: IHelloWorld}>()
Error received is the same mentioned above:
TypeError: Cannot read properties of undefined (reading 'sys')
at resolveFS (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:18372:35)
at importSourceToScope (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:18397:14)
at resolveTypeFromImport (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:18393:23)
at innerResolveTypeReference (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:18299:14)
at resolveTypeReference (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:18288:36)
at innerResolveTypeElements (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:17945:24)
at resolveTypeElements (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:17902:35)
at resolveRuntimePropsFromType (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:19312:20)
at genRuntimePropsFromTypes (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:19288:17)
at genRuntimeProps (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:19278:18)
at compileScript (node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:20383:21)
at processTemplate (node_modules/@vue/vue3-jest/lib/process.js:94:31)
at Object.module.exports [as process] (node_modules/@vue/vue3-jest/lib/process.js:166:26)
at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:545:31)
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:674:40)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:726:19)
at Object.<anonymous> (src/components/Base/Button.spec.ts:4:1)
Hello !
I'm experiencing the same exact same issue than Y0me.
Version
17.2.1
Reproduction link
https://github.com/Y0me/defineProps
Steps to reproduce
npm run dev
What is actually happening?
I'm trying to use the new import type feature in vue 3.3 to defineProps with imported type/interface.
Example
When I compile the project, I get the following errors :
If I wrap the interface, the build succeeds.
What is expected?
I guess a success webpack build.
Thanks !