fix: inline chakra theme helpers to avoid external resolution issues#606
fix: inline chakra theme helpers to avoid external resolution issues#606Agilulfo1820 merged 1 commit intomainfrom
Conversation
Replace @chakra-ui/anatomy imports and createMultiStyleConfigHelpers from @chakra-ui/react with inline equivalents in theme files (card.ts, modal.ts, popover.ts). These were externalized in the dist bundle via tsdown config, causing runtime failures in projects using Chakra UI v3 or Turbopack, where the bundler resolves @chakra-ui/react to v3 which lacks the v2-only createMultiStyleConfigHelpers API. By inlining the anatomy keys and the identity helper functions, the theme system no longer depends on external Chakra packages at runtime. Also removes the now-unnecessary @chakra-ui/anatomy dependency added in the previous fix. Made-with: Cursor
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable poems in the walkthrough.Disable the |
|
Size Change: +702 B (+0.01%) Total Size: 7.62 MB
ℹ️ View Unchanged
|
Summary
@chakra-ui/anatomyimports andcreateMultiStyleConfigHelpersfrom@chakra-ui/reactwith inline equivalents in theme files (card.ts,modal.ts,popover.ts)@chakra-ui/anatomyas a dependency, but the root cause is that both@chakra-ui/anatomyandcreateMultiStyleConfigHelpersare externalized in the dist bundle via the tsdown config. This causes runtime errors (createMultiStyleConfigHelpers is not a function) in projects using Chakra UI v3 or Turbopack, where the bundler resolves@chakra-ui/reactto v3 which lacks this v2-only APIcreateMultiStyleConfigHelpersis an identity helper (definePartsStylereturns its argument,defineMultiStyleConfigadds apartsarray). Inlining these eliminates the external dependency while preserving identical runtime behavior@chakra-ui/anatomydependencyTest plan
yarn typecheckpassesyarn buildsucceeds@chakra-ui/anatomyorcreateMultiStyleConfigHelpersnext dev --turbo) no longer errorsMade with Cursor