Skip to content

fix: restore registry json on vercel cache hit#74

Merged
mxkaske merged 1 commit into
mainfrom
fix/registry-json-missing-on-vercel-cache-hit
Apr 20, 2026
Merged

fix: restore registry json on vercel cache hit#74
mxkaske merged 1 commit into
mainfrom
fix/registry-json-missing-on-vercel-cache-hit

Conversation

@mxkaske

@mxkaske mxkaske commented Apr 20, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #73npx shadcn@latest add https://data-table.openstatus.dev/r/data-table.json returns 404.

  • Root cause: turbo registry:build outputs are scoped to packages/registry/public/r/**, but copy-to-web.mjs also wrote to apps/web/public/r/**. On Vercel cache hits, the copy script doesn't re-run and files outside the task's package scope aren't restored — so apps/web/public/r/ was left empty and Next.js served 404s for /r/*.json.
  • Fix: move the cross-package copy into web:build (via a new apps/web/scripts/copy-registry.mjs) and declare public/r/** as a build output so the files are cached and restored alongside .next/.

Test plan

  • pnpm prettier --check . passes
  • pnpm turbo lint passes
  • pnpm turbo typecheck passes
  • DATABASE_URL= pnpm turbo test passes
  • Fresh pnpm turbo build --filter=web --force produces apps/web/public/r/*.json
  • Cache-hit scenario: delete apps/web/public/r/ + .next/, run pnpm turbo build --filter=webFULL TURBO (522ms) and JSON files are restored
  • Verify production deployment serves https://data-table.openstatus.dev/r/data-table.json with 200

🤖 Generated with Claude Code

The registry JSON files were missing from production deployments
(fixes #73) because turbo's registry:build cache only restores files
inside packages/registry/public/r/, while copy-to-web.mjs also wrote
to apps/web/public/r/ — an output path outside the task's package
scope. When Vercel hit the remote cache, the copy script didn't
re-run and apps/web/public/r/ was left empty, so /r/*.json returned 404.

Move the cross-package copy into web:build and declare public/r/** as
a web:build output so the files are cached and restored alongside
.next/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
data-table-filters Ready Ready Preview, Comment Apr 20, 2026 8:42am

Request Review

@mxkaske mxkaske merged commit 27e1653 into main Apr 20, 2026
8 checks passed
@mxkaske mxkaske deleted the fix/registry-json-missing-on-vercel-cache-hit branch April 20, 2026 08:52
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.

npx shadcn@latest add. The item at https://data-table.openstatus.dev/r/data-table.json was not found. It may not exist at the registry.

1 participant