-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Comments
Good point. We should consider using DTS module augmentation instead. That should work everywhere. |
After looking into this over the weekend, I don't see an easy way around this and would prefer not to support Yarn PnP instead of overcomplicating the codebase. We've improved the types for Sorry for the inconvenience. Please consider setting up nodeLinker for Yarn PnP. |
That's unfortunate. It's not about specifically supporting Yarn PnP. It's about not making assumptions about the specific package manager - and really the development environment - being used in general. Even NPM, pnpm, Bun, and Yarn (even with the node linker) all vary slightly in how they handle I think it's a really weird and unexpected behavior to be modifying files inside |
@segunadebayo Would you still consider the ability to specify a custom output directory for generated types? That would allow a decent workaround. One could then use Yarn's Package patching feature to have correct type information, with a few extra steps:
I'd be happy to put up a PR for it if you'd be open to it. |
Description
I can't use the
typegen
command because I'm using Yarn PnP. Yarn PnP does not use the traditionalnode_modules
folder, so when the Chakra CLI tool attempt to generate types, I get the following error:(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 anever
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
Additional Information
No response
The text was updated successfully, but these errors were encountered: