Skip to content

noUncheckedIndexedAccess: false override not working with vue-tsc --build #42

@Baejw0111

Description

@Baejw0111

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.1
  • vue-tsc: 3.2.1
  • typescript: 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions