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
I need to obtain a hashmap of the SVG source strings for the icons, so I'm using the @tabler/icons package.
Due to project constraints, I can only use import statement, but when trying to do import * as tablerIcons from "@tabler/icons", I'm getting this error:
'Failed to resolve entry for package "@tabler/icons". The package may have incorrect main/module/exports
specified in its package.json: Missing "." specifier in "@tabler/icons" package.
I'm not sure about the spec, but when bundlers see a "exports" in the manifest, they ignore "main" and "module" and abide only by what exports say, and since there's no "." key in there, is not possible to import _ from "@tabler/icons" from the main dist file; this only allows individual imports of the SVG files.
Also, as "exports" obscures the whole package contents, is not possible to do import * as icons from "@tabler/icons/dist/es/tabler-icons.js" either.
The solution would be adding this to "exports":
".": ["./dist/es/tabler-icons.js"],
The text was updated successfully, but these errors were encountered:
Related: I upgraded from version 1.114.0 to 2.29 today for my next project and I'm getting this error
Package path . is not exported from package <project-path>/node_modules/@tabler/icons (see exports field in <project-path>/node_modules/@tabler/icons/package.json)
Here is the working 1.114.0 Version in the package.json:
I need to obtain a hashmap of the SVG source strings for the icons, so I'm using the
@tabler/icons
package.Due to project constraints, I can only use
import
statement, but when trying to doimport * as tablerIcons from "@tabler/icons"
, I'm getting this error:This is caused by having the following
exports
key:I'm not sure about the spec, but when bundlers see a
"exports"
in the manifest, they ignore"main"
and"module"
and abide only by what exports say, and since there's no"."
key in there, is not possible toimport _ from "@tabler/icons"
from the main dist file; this only allows individual imports of the SVG files.Also, as
"exports"
obscures the whole package contents, is not possible to doimport * as icons from "@tabler/icons/dist/es/tabler-icons.js"
either.The solution would be adding this to
"exports"
:The text was updated successfully, but these errors were encountered: