Skip to content

fix(tsconfig): give the node project inputs it can actually have - #1771

Merged
musistudio merged 1 commit into
musistudio:mainfrom
ntdatt812:fix/tsconfig-node-project-inputs
Sep 16, 2026
Merged

musistudio merged 1 commit into
musistudio:mainfrom
ntdatt812:fix/tsconfig-node-project-inputs

Conversation

@ntdatt812

Copy link
Copy Markdown
Contributor

tsc -b fails before it builds anything, and editors report the same error against the file directly — which is where it is usually met:

error TS18003: No inputs were found in config file 'tsconfig.node.json'.
Specified 'include' paths were '["build/**/*.mjs"]' and 'exclude' paths were '[]'.

Why

The include names ten files that do exist (build/build.mjs, build/dev.mjs, …). But TypeScript accepts .mjs as an input only when allowJs is on, and it is not. So the referenced project has no inputs and cannot have any — which a composite project may not.

allowJs is not the fix. With checkJs it surfaces 20 errors in build scripts nobody asked TypeScript to check:

build/benchmark-request-logs.mjs(40,27): error TS2769: No overload matches this call.

Without checkJs it only emits declarations for build tooling. Either is a policy change for you to make, not a repair.

build/ has never held a .ts file (git log --diff-filter=AD -- 'build/*.ts' is empty), so the include has been aspirational since the file arrived.

The change

The root config's include is packages/*/src/** and tests/e2e/**. That leaves playwright.config.ts unchecked by anything — and a node-side config file is exactly what a tsconfig.node.json is for in this layout. Pointing the include there gives the project real inputs and picks up a file that had none.

composite implies declaration emit and forbids noEmit (TS6310), so the output is directed at .tmp/, which .gitignore already covers. Without that, tsc -b drops playwright.config.js and playwright.config.d.ts next to the source.

Verification

before after
tsc -b ✗ TS18003 ✓ exit 0
npm run typecheck ✓ ✓
stray emit at repo root — none (.tmp/)

npm run typecheck was green throughout: it runs tsc --noEmit, which never builds project references. That is why this has sat broken without failing CI.

One thing I did not change: tsc -b also writes tsconfig.tsbuildinfo at the root, and I checked that it does so on main too — it is the root project's own artifact, not a consequence of this fix.

`tsc -b` fails before it builds anything:

  error TS18003: No inputs were found in config file 'tsconfig.node.json'.
  Specified 'include' paths were '["build/**/*.mjs"]' and 'exclude' paths
  were '[]'.

Editors report the same error against the file directly, which is where it
is usually met.

The include names ten files that exist, but TypeScript only takes `.mjs`
as an input when `allowJs` is on, and it is not. So the referenced project
has no inputs and cannot have any, which a composite project may not.

`allowJs` is not the fix. Turning it on with `checkJs` surfaces 20 errors
in build scripts nobody asked TypeScript to check, and turning it on
without `checkJs` only produces declarations for build tooling. Either is
a policy change, not a repair.

`build/` has never held a `.ts` file. What the root config does not cover
is `playwright.config.ts` -- its include is `packages/*/src/**` and
`tests/e2e/**` -- and a node-side config file is what a `tsconfig.node.json`
exists for. Pointing the include there gives the project real inputs and
type-checks a file that was unchecked.

Composite implies declaration emit, so the output goes to `.tmp/`, which is
already ignored, instead of dropping `playwright.config.js` and a `.d.ts`
next to the source.

`npm run typecheck` is unaffected: it runs `tsc --noEmit`, which never
built this reference, which is why the repo has been green with it broken.
@musistudio
musistudio merged commit 3d6e5da into musistudio:main Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants