Skip to content

inertia-react and inertia-vue: typecheck script hides real type errors behind TS5101 baseUrl deprecation #13

@dmaksimov

Description

@dmaksimov

Summary

The inertia-react and inertia-vue starter kits pin typescript: ~6.0.2 and ship an inertia/tsconfig.json with "baseUrl": "." but no "ignoreDeprecations". In TypeScript 6, baseUrl emits TS5101 as a config-level error, which causes tsc to halt before type-checking any source files. The effect is that npm run typecheck reports only TS5101 and suppresses every real type error in the inertia pass. VS Code still surfaces those errors because its language service doesn't halt on the config deprecation, so the two diverge — an error you can see in the editor won't fail CI.

Reproduction

npm create adonisjs@latest scaffold-check -- --kit=react
cd scaffold-check

Inject a trivial type error in inertia/pages/home.tsx:

export default function Home() {
  const _bug: string = 123   // TS2322
  void _bug
  return ( /* ... */ )
}

Run:

npm run typecheck

Observed output:

inertia/tsconfig.json(4,5): error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
exit code: 2

The TS2322 in home.tsx is nowhere in the output. The script does exit non-zero, but the real errors never reach the terminal — developers reading this output see only the deprecation and miss the actual type errors.

Same reproduction on --kit=vue.

Cause

TS 6 promoted the baseUrl deprecation to TS5101. Because it's emitted at the tsconfig level (not in a source file), TypeScript treats it as a fatal configuration error and halts source type-checking for that pass.

Proposed fix

Add one line to each kit's inertia/tsconfig.json:

inertia-react/inertia/tsconfig.json:

"compilerOptions": {
  "baseUrl": ".",
  "ignoreDeprecations": "6.0",
  ...
}

Same addition for inertia-vue/inertia/tsconfig.json.

Verified locally:

  • Before: npm run typecheck reports only TS5101; injected TS2322 is hidden.
  • After: npm run typecheck reports the injected TS2322 as expected.

The api, api-monorepo, and hypermedia kits don't ship an inertia/tsconfig.json with this config and aren't affected.

Long-term (TS 7 removes baseUrl entirely), the permanent migration is to drop baseUrl and rely on implicit / configDir-based paths resolution — but ignoreDeprecations is the right short-term fix while TS 6 is pinned.

Happy to submit a PR once this is confirmed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions