goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.22k stars 134 forks source link

Unable to Resolve Module with Path Mapping in tsconfig.json #149

Closed toliklevy closed 6 months ago

toliklevy commented 6 months ago

Please provide the environment you discovered this bug in.

Angular

https://stackblitz.com/edit/wwbyfs

Which area/package is the issue in?

accordion

Description

If I add to tsconfig.json module

"@spartan-ng/ui-icon-helm": ["./components/ui-icon-helm/src/index.ts"]

and I want to import it in the component as

import { HlmIconComponent } from '@spartan-ng/ui-icon-helm';

I get the error "Error: Module not found: Error: Can't resolve '@spartan-ng/ui-icon-helm'". But if I import directly by specifying the relative path

import { HlmIconComponent } from '../../components/ui-icon-helm/src/index';

everything works.

Please provide the exception or error you saw

Error: Module not found: Error: Can't resolve '@spartan-ng/ui-icon-helm'

Other information

No response

I would be willing to submit a PR to fix this issue

goetzrobin commented 6 months ago

Hey there! I just checked your Stackblitz. Here is the changes I made to the tsconfig that seem to make it work:

Screenshot 2024-02-13 at 5 23 07 PM

Let me know if this helps!

toliklevy commented 6 months ago

Thanks, it works now