-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Describe the bug
When using @vue/[email protected] with vue-tsc --build (project references mode), overriding noUncheckedIndexedAccess: false in tsconfig.app.json does not take effect. The type checker still behaves as if noUncheckedIndexedAccess: true.
Reproduction
tsconfig.json
{
"files": [],
"references": [
{ "path": "./tsconfig.node.json" },
{ "path": "./tsconfig.app.json" }
]
}tsconfig.app.json
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["src/**/*", "src/**/*.vue"],
"compilerOptions": {
"noUncheckedIndexedAccess": false,
"paths": {
"@/*": ["./src/*"]
}
}
}package.json scripts
{
"type-check": "vue-tsc --build",
"build": "run-p type-check \"build-only {@}\" --",
}Example code that errors
const vNodes = slots.default();
if (vNodes.length !== 1) {
return vNodes;
}
// Error: vNodes[0] is VNode | undefined, even though we checked length
cloneVNode(vNodes[0], { ref: wrapperRef });Expected behavior
noUncheckedIndexedAccess: false in tsconfig.app.json should override the true value from @vue/tsconfig/tsconfig.json, and array index access should not include undefined in the type.
Actual behavior
The override is ignored. vNodes[0] is still typed as VNode | undefined.
Workaround
Downgrade to @vue/[email protected] which does not include noUncheckedIndexedAccess.
Environment
@vue/tsconfig: 0.8.1vue-tsc: 3.2.1typescript: 5.8.3 / 5.9.3 (same issue on both)- OS: Windows 10
Additional context
- Clearing build cache (
node_modules/.tmp/*.tsbuildinfo) does not help
Metadata
Metadata
Assignees
Labels
No labels