-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix(ts): export types explicitly #14428
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
Conversation
yury-s
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for this.
900fdef to
ed88353
Compare
|
I won't need a test once we move to TS 4.7. We have the opposite problem though, we might need bots for earlier versions of TS. |
|
any chance for a bugfix release with this change? just noticed it didn't resolve types in native esm mode (node16 module/moduleResolution)... 😮 was going to report it using the following reproduction steps: |
|
@AviVahl you can use the next version |
|
thanks for the tip. 👍 would be useful in own projects, but my team is using some dependencies with stable playwright peerDeps. I'm currently using |
Since the filename pointed at by `default` and `import` (`empty`) is not identical to the filename of the `d.ts` file (`index`), the top level `types` field is not enough when using `"moduleResolution":"Node16"` and TypeScript `4.7`. To fix this, `types` must be explicitly specified inside the `exports` object in addition to the top level `types` field. See [firebase/firebase-js-sdk#6300](/firebase/firebase-js-sdk/issues/6300) and [microsoft/playwright#14428](/microsoft/playwright/pull/14428)
Fixes #14348