Skip to content

Fix injected deps sync when turbo replays cached builds#703

Merged
NullVoxPopuli merged 1 commit into
universal-ember:mainfrom
NullVoxPopuli-ai-agent:fix-sync-turbo-cache
Apr 5, 2026
Merged

Fix injected deps sync when turbo replays cached builds#703
NullVoxPopuli merged 1 commit into
universal-ember:mainfrom
NullVoxPopuli-ai-agent:fix-sync-turbo-cache

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown

Summary

Deploy Preview fails on main with:

Rollup failed to resolve import "ember-primitives/on-resize" from
".../ember-mobile-menu/dist/components/mobile-menu-wrapper.js"

Root cause

ember-mobile-menu resolves ember-primitives through the pnpm store's injected workspace copy. When turbo replays ember-primitives:build from cache, the dist/ files are restored to ember-primitives/dist/ but the injected copy in the pnpm store is never updated — two things prevent it:

  1. //#sync is cached by turbo — the root sync task has no "cache": false, so turbo replays cached logs instead of re-executing
  2. Sync scripts are no-op stubs — they echo a message, relying on pnpm's sync-injected-deps-after-scripts[]=build hook. But that hook only fires when pnpm runs the build script — not when turbo restores outputs from cache

Fix

  • Add "cache": false to //#sync in turbo.json
  • Change sync scripts to pnpm install --frozen-lockfile which re-syncs injected deps

Test plan

Once merged, workflow_dispatch the Deploy Preview targeting PR #699 to verify docs-app builds.

🤖 Generated with Claude Code

Two issues caused the deploy preview docs-app build to fail with:

  Rollup failed to resolve import "ember-primitives/on-resize"

1. The //#sync turbo task was cached, so the root sync script was
   replayed from cache logs instead of re-executed after builds.
   Fix: add "cache": false to //#sync.

2. The sync scripts in docs-app and test-app were no-op echo stubs,
   relying on pnpm's sync-injected-deps-after-scripts hook. But that
   hook only fires when pnpm itself runs the build script — not when
   turbo restores outputs from cache. Fix: change sync scripts to
   run pnpm install --frozen-lockfile, which re-syncs injected deps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NullVoxPopuli NullVoxPopuli merged commit 17eeaea into universal-ember:main Apr 5, 2026
18 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 5, 2026
NullVoxPopuli-ai-agent pushed a commit to NullVoxPopuli-ai-agent/ember-primitives that referenced this pull request Apr 5, 2026
The previous fix (universal-ember#703) put pnpm install --frozen-lockfile in the
sync scripts and made //#sync uncached. But //#sync runs before
ember-primitives:build (it has no dependsOn), so the injected deps
were synced before dist/ existed — same failure.

The correct place is _syncPnpm, which turbo already configures with
dependsOn: ["^build"] and cache: false. This ensures the sync runs
after upstream builds complete (dist/ exists) and before downstream
consumers (docs-app:build:dev).

Changes:
- Add _syncPnpm script to docs-app and test-app: pnpm install --frozen-lockfile
- Restore sync scripts to their original echo stubs
- Restore //#sync to cacheable (it just runs the echo stubs, no need to bust cache)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants