When a registry block is installed through the v0 “Open in v0” button (chat context), import paths that use the @/registry/new-york/... namespace are not rewritten to their final install paths. The same block installs correctly via npx shadcn add in an empty project.
- Registry block:
open-in-v0-chat(shadcn-chat.vercel.app) - v0 chat example: https://v0.app/chat/failed-to-resolve-imports-rauCQH9NK7h
Installed file tree (v0 chat)
components/chat/
data/mock/
hooks/chat/
hooks/use-is-wider.ts
Errors after install
Module not found: Can’t resolve ‘@/registry/new-york/chat/chat’
Module not found: Can’t resolve ‘@/registry/new-york/chat/chat-header’
Module not found: Can’t resolve ‘@/registry/new-york/chat/chat-messages’
Module not found: Can’t resolve ‘@/registry/new-york/chat/chat-toolbar’
Module not found: Can’t resolve ‘@/registry/new-york/blocks/chat-basic/data/mock-api’
Module not found: Can’t resolve ‘@/registry/new-york/blocks/chat-basic/data/users’
Module not found: Can’t resolve ‘@/hooks/use-chat-sidebar’ ← partial rewrite, wrong subdir
Module not found: Can’t resolve ‘@/components/message-items/primary-message’ ← missing /chat/
Expected behavior
All @/registry/new-york/... paths in installed files are rewritten to their target paths (e.g. @/registry/new-york/chat/chat → @/components/chat/chat, @/registry/new-york/blocks/chat-basic/data/messages → @/data/mock/messages).
Observed behavior
-
Some paths (
@/registry/new-york/chat/...,@/registry/new-york/blocks/.../data/...) are not rewritten at all. -
Hook paths lose their subdirectory (
@/hooks/chat/use-messagesbecomes@/hooks/use-messagesinstead). -
Component paths lose the
chat/segment (@/components/chat/message-items/...becomes@/components/message-items/...).
Workaround
Pre-resolve all imports directly in the registry JSON before publishing, so v0 receives already-resolved paths and no rewriting is needed.