Skip to content

fix(docs): redirect use-data-grid-* registry items to tablecn - #290

Open
Dtem4ik wants to merge 1 commit into
sadmann7:mainfrom
Dtem4ik:fix/registry-use-data-grid-undo-redo-redirect
Open

fix(docs): redirect use-data-grid-* registry items to tablecn#290
Dtem4ik wants to merge 1 commit into
sadmann7:mainfrom
Dtem4ik:fix/registry-use-data-grid-undo-redo-redirect

Conversation

@Dtem4ik

@Dtem4ik Dtem4ik commented Jul 4, 2026

Copy link
Copy Markdown

Fixes sadmann7/tablecn#1142

Problem

pnpm dlx shadcn@latest add @diceui/use-data-grid-undo-redo fails with a 404:

The item at https://diceui.com/r/use-data-grid-undo-redo.json was not found.

The file itself exists and is served fine by tablecn (https://tablecn.com/r/use-data-grid-undo-redo.json returns 200). The issue is in the redirect rule in docs/next.config.ts, which forwards data grid registry items to tablecn:

source: "/r/:component(data-table.*\\.json|data-grid.*\\.json)",

The new hook is named use-data-grid-undo-redo, so it doesn't match either alternative. The request falls through to the flat rewrite (/r/:name.json/r/styles/radix-vega/:name.json), and since the item doesn't exist in the local registry, it 404s.

Fix

Add use-data-grid.*\.json as a third alternative to the redirect pattern. It's kept narrow on purpose so diceui's own hooks (use-mobile, use-as-ref, use-lazy-ref, etc.) keep resolving from the local registry. Any future use-data-grid-* hooks published by tablecn will be covered as well.

Verification

Tested the pattern with path-to-regexp (the matcher Next.js uses for redirects()):

Path Result
/r/use-data-grid-undo-redo.json redirected to tablecn ✅
/r/data-grid.json redirected to tablecn (unchanged)
/r/data-table-filter-list.json redirected to tablecn (unchanged)
/r/use-mobile.json falls through to local registry (unchanged)
/r/use-as-ref.json falls through to local registry (unchanged)
/r/radix-vega/data-grid-demo.json falls through to rewrites (unchanged)

The /r redirect to tablecn.com only matched items starting with
data-table or data-grid, so the new use-data-grid-undo-redo hook
fell through to the local registry rewrite and returned 404.

Narrowly match use-data-grid.* so diceui's own hooks
(use-mobile, use-as-ref, etc.) keep resolving locally.

Fixes sadmann7/tablecn#1142
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

@Dtem4ik is attempting to deploy a commit to the sadmann7 Team on Vercel.

A member of the Team first needs to authorize it.

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.

[bug]: Registry 404 Error: @diceui/use-data-grid-undo-redo is missing from registry

1 participant