Skip to content

[BUG]: TypeScript Type Definitions Missing When Installing Components with pnpm #1112

Open

Description

@rafidahmed870

Describe the issue

When I install React Bits components using pnpm in a TypeScript project, the components and their dependencies are installed, but the required TypeScript type definitions are missing.

For example, after installing the Lanyard component, the three package is installed, but its TypeScript type definitions are not available. This results in TypeScript errors when using the component.

I expected the required type definitions for Three.js to be available automatically so that the component would work correctly in a TypeScript project without additional manual configuration.

Reproduction Link

No response

Steps to reproduce

  1. Create a React project with TypeScript enabled.
  2. Install a React Bits component, such as Lanyard, using pnpm.
  3. Install the component's required dependencies.
  4. Run the development server or check the project for TypeScript errors.
  5. Observe that type definitions for three dependencies are missing or unavailable.

Validations

  • I have checked other issues to see if my issue was already reported or addressed

Activity

  1. harshbhx commented on Oct 23, 2026

    @harshbhx

    Hi! I looked into this and I can reproduce what's happening from the registry output.

    The TypeScript variants (for example Lanyard-TS-CSS.json) only list runtime packages under dependencies, so the CLI installs three@^0.180.0 but never @types/three. three doesn't ship its own types, so a TypeScript project gets "could not find a declaration file for module 'three'" until you add the types by hand. It isn't specific to pnpm; the shadcn and jsrepo installs behave the same way.

    The same gap affects the other components that import three or matter-js (BlobCursor, ColorBends, Hyperspeed, ModelViewer, FolderFloat, PaperCrumple, FallingText), in both TS variants.

    Plan: have jsrepo.config.ts add the matching @types/* package to devDependencies of the TS registry items (version taken from the repo's own package.json) and regenerate those public/r/*.json files. JS variants stay untouched, and no component code changes.

    I'll open a PR for this unless you'd rather handle it another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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