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
The generated index.esm.js file lacks namespaces and conflicts with the typescript definitions.
The distributed module contents only define the names found inside the icons and spots modules, which then are all exported as is. Because of this, you can't actually use import { IconFaceMindBlown } from "@stackoverflow/stacks-icons/icons"; as the documentation claims.
Instead, you get an error:
index.ts:1:35 - error TS2307: Cannot find module '@stackoverflow/stacks-icons/icons' or its corresponding type declarations.
1 import { IconFaceMindBlown } from "@stackoverflow/stacks-icons/icons";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can't simply use import { IconFaceMindBlown } from "@stackoverflow/stacks-icons"; as the type information tells typescript that at that level only Icons and Spots are available.
To reproduce, in an empty directory create the following three files:
You are using "moduleResolution": "node" which does not support package.json exports.
The value "node" represents the resolution of Node 10, which never included package.json exports support (exports started to be supported from Node 12+).
If you change the moduleResolution value to nodenext (or any node >= 12) everything should work as expected.
The generated
index.esm.js
file lacks namespaces and conflicts with the typescript definitions.The distributed module contents only define the names found inside the
icons
andspots
modules, which then are all exported as is. Because of this, you can't actually useimport { IconFaceMindBlown } from "@stackoverflow/stacks-icons/icons";
as the documentation claims.Instead, you get an error:
You can't simply use
import { IconFaceMindBlown } from "@stackoverflow/stacks-icons";
as the type information tells typescript that at that level onlyIcons
andSpots
are available.To reproduce, in an empty directory create the following three files:
package.json
tsconfig.json
index.ts
then run
The text was updated successfully, but these errors were encountered: