Angular Library Module Import Error

I created an angular library using ng generate library. All the file were generated correctly. However when I try to import the library module inside my app module I get the red squiggly error if I import the module from the library name. The project will build and run properly but I would like to fix the annoying error. The error only goes away if I import the module from the exact path.


Class JetpackModule is not an Angular module:
Inspection Info: Reports any symbols that are declared, imported or exported by an Angular module that are not modules, components, directives or pipes or can’t be used in the context of the property.



Another side effect of this error is the component tag squiggly.


Component or directive matching jp-jetpack element is out of the current Angular module's scope.

Inspection Info: Reports tags, which are defined by components or directives out of current scope. 




try un-excluding the dist directory (from the folder right-click menu, choose Mark directory as/Not Excluded) - does the issue persist?


Yeah, I also have this issue and I excluded the dist dir.


It should be not neccessary to mark not excluded when a library is referenced in the tsconfig.json.

I think this should be automatically recognized by the ide and force indexed.


I fixed it, check if there's no extra nested somewhere. I had one that overrid the others, which caused the paths not to work.


Please sign in to leave a comment.