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

Typings don't work when cborg is imported in a ESM project #77

Closed
Aenigma opened this issue May 8, 2023 · 2 comments
Closed

Typings don't work when cborg is imported in a ESM project #77

Aenigma opened this issue May 8, 2023 · 2 comments

Comments

@Aenigma
Copy link

Aenigma commented May 8, 2023

I'm using an ESM module project to import cborg and I got this error trying to use it from VS Code.

Could not find a declaration file for module 'cborg'. '~/projects/my-project/node_modules/cborg/esm/cborg.js' implicitly has an 'any' type.
  There are types at '~/projects/my-project/node_modules/cborg/types/cborg.d.ts', but this result could not be resolved when respecting package.json "exports". The 'cborg' library may need to update its package.json or typings.ts(7016)

I could make the error go away by changing the exports in package.json and I'm happy to PR that change, but I'm not sure what exactly best practices are in this realm.

@rvagg
Copy link
Owner

rvagg commented Sep 7, 2023

See #91, you can help test by installing [email protected] and seeing if it works for you.

@rvagg
Copy link
Owner

rvagg commented Sep 11, 2023

should be fixed by 3.0.0

@rvagg rvagg closed this as completed Sep 11, 2023
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