[Demo] Tanstack db demo update #796
Merged
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.
Fix TanStack DB Demo Module Resolution & Add E2E Tests
Problem
The TanStack DB demo fails to run with
pnpm dev, showing the following error:Root Cause
This is caused by pnpm's package hoisting behavior in the monorepo:
@tanstack/powersync-db-collectionis hoisted to the rootnode_modulesfolder@powersync/commonas a peer dependency@powersync/commonas a directworkspace:*dependency, which symlinked it to the demo'snode_modulesonly@tanstack/powersync-db-collectionfrom the root, it cannot resolve@powersync/commonbecause it's not present at the root levelSolution
Remove the direct
@powersync/commondependency from the demo. The package is already available transitively through@powersync/web, which resolves the hoisting issue.Additional Changes
Added end-to-end tests for the demo that run outside of the monorepo context. These tests: