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

ESM types are wrong #205

Closed
wooorm opened this issue Nov 30, 2023 · 4 comments · Fixed by #207 or #208
Closed

ESM types are wrong #205

wooorm opened this issue Nov 30, 2023 · 4 comments · Fixed by #207 or #208
Assignees
Labels

Comments

@wooorm
Copy link

wooorm commented Nov 30, 2023

Expected Behavior

Be able to use the default normally from ESM.

Actual Behavior

The CJS types are specified for ESM users.
But the CJS types are for CJS, not for ESM.

Steps to Reproduce

Should be possible to reproduce from any ESM file.

Reproducible Demo

syntax-tree/hast-util-to-jsx-runtime@89b9292

Environment

n/a

Keywords

Extra

a) you can drop the root types field in package.json
b) generate an esm/index.d.mts
c) you can drop the exports.types fields, they are the defaults for cjs/index.js -> cjs/index.d.ts, esm/index.mjs -> esm/index.d.mts

@remarkablemark
Copy link
Owner

remarkablemark commented Dec 1, 2023

Thanks for opening this issue @wooorm, I opened a PR for the fix #207

@remarkablemark
Copy link
Owner

@vitalijalbu
Copy link

I have the same issue I think:

Screenshot 2024-10-02 alle 07 32 58

@remarkablemark
Copy link
Owner

@vitalijalbu do you mind opening a new issue?

Repository owner locked as resolved and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants