0

I created a svg icons library using angular-cli@14 and svg-to-ts and published it.

In the demo project for the library, it works fine when I import any icon.

When I consume this package in real angular project I got this error.

Module not found: Error: Package path ./icons is not exported from package C:\Sites\frontend\no de_modules@my-icons\icons (see exports field in C:\Sites\powerhouse\frontend\node_modules@my-icons\icons\package.json)

this is my package.json file looks like after building for the library. enter image description here

this is my ng-pacakge.json enter image description here

Please help. I'm stuck for days to fix this issue. When I'm consuming the library in my angular project.

import { piProjects } from '@my-icons/icons/icons';

eslint not showing any error when I import this piProjects icon and also when go to this icons it navigates me to .d.ts file of that icon. and there the adjacent file .mjs icons exist as well.

but when I run angular project with ng serve then it failed due to above mentioned error.

Fawad Mukhtar
  • 780
  • 5
  • 9

0 Answers0