#10472·chakra-ui

@chakra-ui/cli typegen custom outPath results in missing relative paths

Author: haxxxtonCreated Nov 17, 2025Updated Sep 11, 2026
Labelsstale

Description

When running @chakra-ui/cli typegen ./path-to-theme.ts --outdir ./some/local/path chakra correctly outputs 5 .gen.d.ts files (conditions, prop-types, recipes, system, token).

However,

  • prop-types.gen.d.ts file attempts to still import
    typescript
     import type { CssProperties } from "../css.types"
  • recipes.gen.d.ts file attempts to still import
    typescript
    import type { RecipeDefinition, SlotRecipeDefinition, SystemRecipeFn, SystemSlotRecipeFn } from "../recipe.types"
    import type { ConditionalValue } from "../css.types"
  • system.gen.d.ts file attempts to still import
    typescript
     import type { ConditionalValue, CssProperties } from "../css.types"

These relative links dont exist relative to the --outdir. While it could be updated to import these types from @chakra-ui/react, however, the type CssProperties is not currently exported.

This also likely gets difficult as some files inside styled-system appear to rely upon the content of the generated folder. Which likely breaks any use of custom outdir

Image

Link to Reproduction

https://stackblitz.com/edit/chakra-ui-v3-3xqhsu72?file=src%2Fcustom-theme.ts,package.json

Steps to reproduce

  1. Go to Reproduction Link 2a. Either run npm run chakra:typegen to generate types locally; OR 2b. Open prop-types, recipes, or system generated types
  2. Observe relative links

Chakra UI Version

^3.28.1

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response