You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
defineProps runtime props inference misses Array from MaybeRef<T[]> in union type after upgrading to Vue 3.5.31 #14729
Array is missing, so passing an array value triggers runtime warning:
[Vue warn]: Invalid prop: type check failed for prop "options". Expected Promise | Function, got Array
If I explicitly add OptionItem[] in the union (instead of relying only on MaybeRef<OptionItem[]>), the generated runtime type includes Array and warning disappears.
What is expected?
Runtime props inference should include Array branch (or at least not narrow in a way that rejects valid array values from MaybeRef<OptionItem[]>).
For this case, expected generated runtime type should include:
type: [Array,Promise,Function]
What is actually happening?
Generated runtime type is:
type: [Promise,Function]
which rejects array values at runtime.
System Info
Any additional comments?
This looks like a boundary case in SFC type-to-runtime props inference for complex union types involving MaybeRef<T[]>.
If this should be tracked in another Vue package (e.g. compiler-sfc), please let me know and I can move the issue with the same repro.
Hi! I've put up a fix in #14758 with it, your repro emits type: [Object, Array, Promise, Function] and the warning goes away.
To understand the underlying cause, could you share your packages/app/tsconfig.json both package.json files, and the output of node -e "console.log(require.resolve('vue'))" run from packages/app/? I suspect vue's .d.ts isn't reachable from ui-lib's emitted types in your monorepo layout, and that'd be useful to confirm.
Hi! I've put up a fix in #14758 with it, your repro emits type: [Object, Array, Promise, Function] and the warning goes away. To understand the underlying cause, could you share your packages/app/tsconfig.json both package.json files, and the output of node -e "console.log(require.resolve('vue'))" run from packages/app/? I suspect vue's .d.ts isn't reachable from ui-lib's emitted types in your monorepo layout, and that'd be useful to confirm.
Thanks! Here are the requested files from my repro monorepo.
Activity
edison1105 commentedon Apr 16, 2026
This issue should have existed all along — the compiler did not parse
MayRef<T>, butskipCheckwas added in the DEV.However, when the third-party library is bundled (in PROD),
skipCheckis stripped out, which is why the warning appears when using it in the project.aschoube commentedon Apr 26, 2026
Hi! I've put up a fix in #14758 with it, your repro emits
type: [Object, Array, Promise, Function]and the warning goes away.To understand the underlying cause, could you share your
packages/app/tsconfig.jsonbothpackage.jsonfiles, and the output ofnode -e "console.log(require.resolve('vue'))"run frompackages/app/? I suspectvue's .d.tsisn't reachable from ui-lib's emitted types in your monorepo layout, and that'd be useful to confirm.wuchunxu commentedon Apr 27, 2026
Thanks! Here are the requested files from my repro monorepo.
packages/app/tsconfig.json:{ "extends": "../../tsconfig.base.json", "include": ["src/**/*.ts", "src/**/*.vue"] }packages/app/package.json{ "name": "app", "private": true, "type": "module", "scripts": { "dev": "vite" }, "dependencies": { "ui-lib": "workspace:*", "vue": "^3.5.31" }, "devDependencies": { "@vitejs/plugin-vue": "^6.0.5", "typescript": "^5.6.3", "vite": "^8.0.8" } }packages/ui-lib/package.json:{ "name": "ui-lib", "version": "0.0.0", "type": "module", "main": "dist/ui-lib.umd.cjs", "module": "dist/ui-lib.js", "exports": { ".": { "import": "./dist/ui-lib.js", "require": "./dist/ui-lib.umd.cjs" } }, "scripts": { "build": "vite build" }, "dependencies": { "vue": "^3.5.31" }, "devDependencies": { "@vitejs/plugin-vue": "^6.0.5", "typescript": "^5.6.3", "vite": "^8.0.8" } }Output of running from packages/app/:
fix(compiler-sfc): infer Vue ref wrapper types when source is unresol…