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

Bug: Missing types for ESM build #328

Closed
cj-christoph-gysin opened this issue Sep 4, 2023 · 1 comment
Closed

Bug: Missing types for ESM build #328

cj-christoph-gysin opened this issue Sep 4, 2023 · 1 comment

Comments

@cj-christoph-gysin
Copy link

This module is not shipping types for ESM modules:

$ ls -1 node_modules/streaming-iterables/dist/
index.d.ts
index.d.ts.map
index.js
index.mjs

When using this from ESM, I get:

error| Could not find a declaration file for module 'streaming-iterables'. 'dist/index.mjs' implicitly has an 'any' type. 
There are types at 'dist/index.d.ts', but this result could not be resolved when respecting package.json "exports".
The 'streaming-iterables' library may need to update its package.json or typings.

This led me to microsoft/TypeScript#52363, where someone provided a nice checker: https://arethetypeswrong.github.io/[email protected]

The error message is a bit confusing IMO, but the issue seems to be that the provided types are only valid for the CJS build:

... index.d.ts is not a "sibling" file to index.mjs - that would be index.d.mts.

@reconbot
Copy link
Owner

reconbot commented Sep 9, 2023

Give v8.0.1 a try it should be fixed now. Thanks for the heads up!

@reconbot reconbot closed this as completed Sep 9, 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

No branches or pull requests

2 participants