Skip to content

fix(turbo): build json-render-ui before hub-vite and hub-next - #201

Merged
antfu merged 1 commit into
mainfrom
fix/turbo-hub-json-render-ui-build-order
Aug 13, 2026
Merged

fix(turbo): build json-render-ui before hub-vite and hub-next#201
antfu merged 1 commit into
mainfrom
fix/turbo-hub-json-render-ui-build-order

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Why

CI's e2e job (`pnpm test:e2e`) has been intermittently failing during the build step with:

```
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../examples/hub-vite/node_modules/@devframes/json-render-ui/dist/hub.mjs'
```

Both `examples/hub-vite` and `examples/hub-next` dynamically `import('@devframes/json-render-ui/hub')` at runtime, and both declare `@devframes/json-render-ui` as a `package.json` dependency. But `turbo.json` gives `hub-vite#build` and `hub-next#build` an explicit `dependsOn` list that overrides turbo's default `^build` (upstream-workspace) behavior — and that list was missing `@devframes/json-render-ui#build`. On a cold cache, turbo could start building the hub examples before `json-render-ui`'s `dist/hub.mjs` existed, racing the failure above.

What

Add `@devframes/json-render-ui#build` to both tasks' `dependsOn` lists.

Verification

  • Reproduced the failure locally with a forced, fully-cold `turbo run build` before the fix (hub-vite/hub-next started before json-render-ui finished).
  • Confirmed the fix orders the tasks correctly and a full `turbo run build --force` succeeds.
  • `pnpm lint`, `pnpm knip`, `pnpm test` (1105 tests), `pnpm typecheck`, and `pnpm test:e2e` (17/17, including a CI-mode run with cold servers) all pass.

🤖 Generated with the help of an agent

Both examples dynamically import `@devframes/json-render-ui/hub` at
runtime, but neither task's explicit turbo dependsOn list included
`@devframes/json-render-ui#build`. On a cold cache, turbo could run
hub-vite/hub-next's build before json-render-ui finished, failing with
ERR_MODULE_NOT_FOUND on dist/hub.mjs — the failure seen in the e2e CI job.
@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit dbed39d
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a7d7cc9881b49000831dcd3
😎 Deploy Preview https://deploy-preview-201--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu
antfu merged commit b9f5c2f into main Aug 13, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants