You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With recent versions of TypeScript (currently v4.7.4) and with project TypeScript config compilerOptions.module set to nodenext, the types for this package are not available when importing from within an ESM module:
The hover intellisense doesn't include the right types (cc arg should be type string):
If you CMD + click the import, it opens the country-code-emoji/lib/index.mjs module instead of the country-code-emoji/lib/index.d.ts file you would expect if the types were working.
I think the reason is because the package exports field incorrectly doesn't start with a types property:
With recent versions of TypeScript (currently v4.7.4) and with project TypeScript config
compilerOptions.module
set tonodenext
, the types for this package are not available when importing from within an ESM module:The hover intellisense doesn't include the right types (
cc
arg should be typestring
):If you CMD + click the import, it opens the
country-code-emoji/lib/index.mjs
module instead of thecountry-code-emoji/lib/index.d.ts
file you would expect if the types were working.I think the reason is because the package
exports
field incorrectly doesn't start with atypes
property:country-code-emoji/package.json
Lines 11 to 14 in 38faa2b
"exports": { + "types": "./lib/index.d.ts", "import": "./lib/index.mjs", "require": "./lib/index.js" },
See:
https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing
The text was updated successfully, but these errors were encountered: