Skip to content

Bug: TypeScript build failing due to missing shadcn/ui dependencies #1790

@ArshVermaGit

Description

@ArshVermaGit

Description

The local build and CI pipelines are currently broken because the TypeScript compiler (npm run type-check) is failing. The codebase is missing critical dependencies required by shadcn/ui components (specifically the badge and button components) and the idb-keyval module used in testing.

When running npm run type-check, the following errors are thrown:
```
src/components/ui/badge.tsx(2,40): error TS2307: Cannot find module 'class-variance-authority' or its corresponding type declarations.
src/components/ui/button.tsx(2,40): error TS2307: Cannot find module 'class-variance-authority' or its corresponding type declarations.
src/lib/utils.ts(2,25): error TS2307: Cannot find module 'tailwind-merge' or its corresponding type declarations.
test/ContributionGraph.test.ts(5,26): error TS2307: Cannot find module 'idb-keyval' or its corresponding type declarations.
```
Additionally, class-variance-authority missing causes cascading property type errors like Property 'variant' does not exist on type 'BadgeProps'.

Expected Behavior

  • The npm run type-check command should exit with code 0.
  • All dependencies used in UI components (like class-variance-authority, tailwind-merge, clsx, and lucide-react) should be correctly installed and present in package.json.

Steps to Reproduce

  1. Clone the repository and run npm install.
  2. Run npm run type-check.
  3. Observe the TS2307 and TS2339 errors causing the build to fail.

Suggested Fix

  1. Install the missing dependencies for the UI components and tests:
    ```bash
    npm install class-variance-authority tailwind-merge clsx idb-keyval
    ```
  2. Verify if @types are needed for any of the above packages.
  3. Run npm run type-check again to confirm the build passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions