Remove @tanstack/db from the db add-on template's dependencies. #238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
When using the Start CLI with the
@tanstack/dbadd-on, we end up with redundant dependencies:@tanstack/db- Base JavaScript library@tanstack/react-db- React wrapper (which depends on@tanstack/db)This creates a duplicate dependency problem where both packages are listed as direct dependencies, causing TypeScript type conflicts between identical types from different
node_modulespaths.Dependency Analysis
bun why @tanstack/react-db @tanstack/react-db@0.1.49 └─ . (requires ^0.1.49)As shown above,
@tanstack/react-dbalready requires@tanstack/dbas a dependency. The CLI is adding both packages directly topackage.json, which causes TypeScript to see them as separate types from different paths.Solution
Remove
@tanstack/dbfrom the db add-on template's direct dependencies.@tanstack/react-dbwill transitively provide@tanstack/db, avoiding duplication and type conflicts.What This Changes
Before:
{ "dependencies": { "@tanstack/db": "^0.5.5", "@tanstack/query-db-collection": "^0.2.0", "@tanstack/react-db": "^0.1.1", "zod": "^4.0.14" } }After:
{ "dependencies": { "@tanstack/query-db-collection": "^0.2.0", "@tanstack/react-db": "^0.1.1", "zod": "^4.0.14" } }This ensures only one copy of
@tanstack/dbexists in the dependency tree, eliminating the TypeScript type conflicts.