Skip to content

[bug]: Path resolution problem #8308

@jiahao-jayden

Description

@jiahao-jayden

Describe the bug

I have a registered component as follows.

  {
      "name": "sign-in",
      "type": "registry:component",
      "title": "Sign In",
      "description": "A sign in component, using better-auth and drizzle",
      "dependencies": [
        "better-auth",
        "drizzle-orm",
        "drizzle-kit",
        "@tanstack/react-query",
        "@react-email/components",
        "resend",
        "postgres",
        "generate-avatar",
        "lucide-react"
      ],
      "registryDependencies": [
        "button",
        "input",
        "label",
        "textarea",
        "card",
        "form",
        "input-otp",
        "separator",
        "dialog"
      ],
      "files": [
        {
          "path": "registry/default/blocks/sign-in/components/sign-in/index.tsx",
          "type": "registry:block"
        },
        {
          "path": "registry/default/blocks/sign-in/components/sign-in/icon.tsx",
          "type": "registry:block"
        },
        {
          "path": "registry/default/blocks/sign-in/components/email/otp-email.tsx",
          "type": "registry:block"
        },
        {
          "path": "registry/default/blocks/sign-in/lib/auth/client-auth.ts",
          "type": "registry:lib"
        },
        {
          "path": "registry/default/blocks/sign-in/lib/auth/server-auth.ts",
          "type": "registry:lib"
        },
        {
          "path": "registry/default/blocks/sign-in/lib/create-email.ts",
          "type": "registry:lib"
        },
        {
          "path": "registry/default/db/auth-schema.ts",
          "type": "registry:file",
          "target": "db/auth-schema.ts"
        },
        {
          "path": "registry/default/db/index.ts",
          "type": "registry:file",
          "target": "db/index.ts"
        },
        {
          "path": "registry/default/db/schema.ts",
          "type": "registry:file",
          "target": "db/schema.ts"
        },
        {
          "path": "registry/default/lib/utils.ts",
          "type": "registry:lib"
        }
      ],
      "envVars": {
        "RESEND_API_KEY": "",
        "GOOGLE_CLIENT_ID": "",
        "GOOGLE_CLIENT_SECRET": ""
      }
    },

My file structure

registry
└── default
    ├── blocks
    │   └── sign-in
    │       ├── components
    │       │   ├── email
    │       │   │   └── otp-email.tsx
    │       │   └── sign-in
    │       │       ├── icon.tsx
    │       │       └── index.tsx
    │       └── lib
    │           ├── auth
    │           │   ├── client-auth.ts
    │           │   └── server-auth.ts
    │           └── create-email.ts
    ├── db
    │   ├── auth-schema.ts
    │   ├── index.ts
    │   └── schema.ts
    ├── lib
    │   └── utils.ts
    └── ui
        ├── button.tsx
        ├── card.tsx
        ├── dialog.tsx
        ├── form.tsx
        ├── input-otp.tsx
        ├── input.tsx
        ├── label.tsx
        ├── separator.tsx
        └── textarea.tsx

Problem

Among them, in 'server-auth.ts', there is such an import:

import db from "@/registry/default/db"

When this component is installed, it becomes:

 import db from "@/components/db"

Why didn't it turn out like this:

 import db from "@/db"

Affected component/components

none

How to reproduce

none

Codesandbox/StackBlitz link

No response

Logs

System Info

none

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions