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

CommonJS Types appear incorrect #2838

Closed
charliematters opened this issue Nov 13, 2023 · 2 comments · Fixed by #2880
Closed

CommonJS Types appear incorrect #2838

charliematters opened this issue Nov 13, 2023 · 2 comments · Fixed by #2880
Assignees

Comments

@charliematters
Copy link

charliematters commented Nov 13, 2023

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

1.7.17

What browser are you using?

Typescript

Reproduction URL
https://github.com/charliematters/tshy-repo

Describe your issue

I've been trying to use headless ui as part of an internal component package, which is compiled to ESM and CJS versions by tshy.

When trying to produce the CJS bundle I get the same error as this closed issue: #2386 (comment)

I asked the author of thetshy package for some advice and he pointed me towards this page, which reports that the CJS types are just copies of the ESM ones, which apparently will not work:

https://arethetypeswrong.github.io/?p=%40headlessui%2Freact%401.7.17

@thecrypticace
Copy link
Contributor

Hey, comically enough our type files were technically correct for CJS types it's just the resolution that was wrong. I did a quick and dirty fix to get things working.

Also found an ESM typing issue in our @headlessui/tailwindcss package because of this work too which I've fixed.

This will be available in the next tagged release. It'll also available in our insiders build in a few minutes:

npm install @headlessui/react@insiders
npm install @headlessui/vue@insiders

Thanks!

@charliematters
Copy link
Author

No, thank you!

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

Successfully merging a pull request may close this issue.

2 participants