Skip to content

Commit a5c3594

Browse files
authored
fix: missing types with "moduleResolution":"Node16"
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)
1 parent 0da9a47 commit a5c3594

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"sideEffects": false,
1919
"exports": {
2020
"default": "./empty.js",
21-
"import": "./empty.js"
21+
"import": "./empty.js",
22+
"types": "./index.d.ts"
2223
},
2324
"main": "./empty.js",
2425
"types": "./index.d.ts",

0 commit comments

Comments
 (0)