tabler-icons icon indicating copy to clipboard operation
tabler-icons copied to clipboard

React - Module not found: Package path . is not exported from package

Open evokelektrique opened this issue 5 months ago • 1 comments

I can't use this library with react in my nextjs application, i get the following error:

Code:

import { IconAward } from "@tabler/icons";
...
 <IconAward
    size={36} // set custom `width` and `height`
    color="red" // set `stroke` color
    stroke={3}  // set `stroke-width`
    strokeLinejoin="miter" // override other SVG props
  />

Error:

Module not found: Package path . is not exported from package <PATH_TO_MY_APPLICATION>/node_modules/@tabler/icons (see exports field in <PATH_TO_MY_APPLICATION>/node_modules/@tabler/icons/package.json)

Package Version: "@tabler/icons": "^2.46.0",

is there a solution for this ?

evokelektrique avatar Jan 13 '24 12:01 evokelektrique

I've had the same issue and what I found is that I was using the wrong package. If you are using React (or NextJS, since it's again React), you ought to be using the dedicated React package for the tabler icons. Here's a link for it: https://www.npmjs.com/package/@tabler/icons-react

Switching to this package solved the Module not found bug for me. Good luck

ZombieChowder11 avatar Feb 09 '24 16:02 ZombieChowder11