microsoft / microsoft/TypeScript

"Referenced projects must have the new composite setting enabled" does not hold true

Open
#60,465 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Docs
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

🔎 Search Terms

composite, project references, solution-style tsconfig

🕗 Version & Regression Information
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about tsconfig.
⏯ Playground Link

https://vite.new/react-ts

💻 Code

The above link is a project created from the vite react-ts template (https://vite.new/react-ts).
It uses project references in tsconfig.json, but no composite: true specified in both tsconfig.app.json and tsconfig.node.json.

On the other hand, the TypeScript handbook says:

Referenced projects must have the new composite setting enabled.

🙁 Actual behavior

The project builds (npm run build) successfully without composite: true.

🙂 Expected behavior

If I understand correctly, the documentation means I have to specify composite: true when using references. I'd expect an error or warning if I didn't follow the guide.

Additional information about the issue

I'm curious whether it's a bug or a feature.
If it's a bug, what's the expected behavior?
If it's a feature, I'd like to see the documentation updated accordingly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the project references and composite section in the TypeScript handbook, then reproduce the behavior with the referenced tsconfig.json, tsconfig.app.json, and tsconfig.node.json from the Vite React TypeScript template using npm run build. Resolve whether composite is required and document the resulting behavior or expected diagnostic so the handbook matches the implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.