Home / Function/ constructor() — ui Function Reference

constructor() — ui Function Reference

Architecture documentation for the constructor() function in errors.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  88e9a0eb_faf0_c7f4_d012_5dac39c7a75e["constructor()"]
  b03f6fd2_007b_5687_2ffd_85d3c69c5892["ConfigParseError"]
  88e9a0eb_faf0_c7f4_d012_5dac39c7a75e -->|defined in| b03f6fd2_007b_5687_2ffd_85d3c69c5892
  style 88e9a0eb_faf0_c7f4_d012_5dac39c7a75e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/registry/errors.ts lines 269–286

  constructor(public readonly cwd: string, parseError: unknown) {
    let message = `Invalid components.json configuration in ${cwd}.`

    if (parseError instanceof z.ZodError) {
      message = `Invalid components.json configuration in ${cwd}:\n${parseError.errors
        .map((e) => `  - ${e.path.join(".")}: ${e.message}`)
        .join("\n")}`
    }

    super(message, {
      code: RegistryErrorCode.INVALID_CONFIG,
      cause: parseError,
      context: { cwd },
      suggestion:
        "Check your components.json file for syntax errors or invalid configuration. Run 'npx shadcn@latest init' to regenerate a valid configuration.",
    })
    this.name = "ConfigParseError"
  }

Subdomains

Frequently Asked Questions

What does constructor() do?
constructor() is a function in the ui codebase, defined in packages/shadcn/src/registry/errors.ts.
Where is constructor() defined?
constructor() is defined in packages/shadcn/src/registry/errors.ts at line 269.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free