Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typegen does not work with Yarn PnP #9440

Open
3 tasks
joekrill opened this issue Jan 7, 2025 · 1 comment
Open
3 tasks

typegen does not work with Yarn PnP #9440

joekrill opened this issue Jan 7, 2025 · 1 comment

Comments

@joekrill
Copy link
Contributor

joekrill commented Jan 7, 2025

Description

I can't use the typegen command because I'm using Yarn PnP. Yarn PnP does not use the traditional node_modules folder, so when the Chakra CLI tool attempt to generate types, I get the following error:

Error: EROFS: read-only filesystem, open '/node_modules/@chakra-ui/react/dist/types/styled-system/generated/conditions.gen.d.ts'

(actually 4 of these errors for each file that is generated).

The typegen tool really shouldn't be writing to the node_modules folder anyway, or assuming it's writable. Would it be possible to specify a custom output folder for these types? Would that even work with how the library reads these types?

This is causing other type errors in my codebase. In particular if I try to use useSlotRecipe for a custom component it returns a never type because - as far as it is concerned - the slot doesn't even exist.

Link to Reproduction

n/a

Steps to reproduce

No response

Chakra UI Version

3.2.5

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

@segunadebayo
Copy link
Member

Good point. We should consider using DTS module augmentation instead. That should work everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants