Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsc: Referenced project must have setting "composite": true. #3401

Open
JedBeom opened this issue Mar 4, 2025 · 2 comments · May be fixed by #3402
Open

tsc: Referenced project must have setting "composite": true. #3401

JedBeom opened this issue Mar 4, 2025 · 2 comments · May be fixed by #3402

Comments

@JedBeom
Copy link

JedBeom commented Mar 4, 2025

Library Affected:
All workbox libraries referencing other workbox libraries

Typescript Version:
5.7.3

I use workbox-precaching for my project. However I've got these messages from VS Code:

Referenced project '/path/to/node_modules/workbox-core' must have setting "composite": true.

Referenced project '/path/to/node_modules/workbox-routing' must have setting "composite": true.

Referenced project '/path/to/node_modules/workbox-strategies' must have setting "composite": true.

Image

According to the TypeScript Handbook, referenced projects must have the new composite setting enabled.

It seems the libraries below referenced by other libraries:

  1. workbox-background-sync
  2. workbox-broadcast-update
  3. workbox-build
  4. workbox-cacheable-response
  5. workbox-core
  6. workbox-expiration
  7. workbox-google-analytics
  8. workbox-routing
  9. workbox-strategies

Adding "composite": true to each tsconfig.json would fix these warnings.

@westonruter
Copy link
Collaborator

@JedBeom I opened #3402 to address this.

How are you using workbox-precaching in your project? Can you provide a sample to reproduce this issue?

And how did you determine which packages (libraries) referenced other packages?

@JedBeom
Copy link
Author

JedBeom commented Mar 4, 2025

@westonruter I made a sample repository: https://github.com/JedBeom/workbox-composite-demo

I checked each packages/*/tsconfig.json to find which packages are referenced by other packages, like:

"references": [
{"path": "../workbox-background-sync/"},
{"path": "../workbox-broadcast-update/"},
{"path": "../workbox-cacheable-response/"},
{"path": "../workbox-core/"},
{"path": "../workbox-expiration/"},
{"path": "../workbox-google-analytics/"}
]

"references": [
{"path": "../workbox-core/"},
{"path": "../workbox-routing/"},
{"path": "../workbox-strategies/"}
]

"references": [{"path": "../workbox-build/"}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants