Generation of library produces tslint error like "'Component' is not included in a module"
See original GitHub issueVersions
Angular CLI: 6.0.0
Node: 8.9.4
OS: win32 x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.6.0
@angular-devkit/build-angular 0.6.0
@angular-devkit/build-ng-packagr 0.6.0
@angular-devkit/build-optimizer 0.6.0
@angular-devkit/core 0.6.0
@angular-devkit/schematics 0.6.0
@ngtools/json-schema 1.1.0
@ngtools/webpack 6.0.0
@schematics/angular 0.6.0
@schematics/update 0.6.0
ng-packagr 3.0.0-rc.2
rxjs 6.1.0
typescript 2.7.2
webpack 4.6.0
Repro steps
ng new projectX && cd projectX && ng generate library my-lib
- Open project in Webstorm (I’m using v2018.1)
Observed behavior
Project builds successfully but linter shows error like:
Error:(3, 2) ng: Component ‘MyLibComponent’ is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration
TypeScript config:
Desired behavior
Cli should produce code that passes all tslint checks.
Mention any other details that might be useful (optional)
Of course it it is not critical, but kind of annoying issue
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Angular Error: 'Component 'X' is not included in a module ...
To anybody struggling with this error, the solution is to add the component to the NgModule declaration which can be found ...
Read more >The Best Way To Architect Your Angular Libraries
ts will be used to export all the entities (like modules, components, services or directives) that belong to the particular sub-entry. Currently ...
Read more >Angular compiler options
ts file that is not included in the .d.ts file produced by the TypeScript compiler. This information includes, for example, the content of...
Read more >Angular Modules and NgModule - Complete Guide
If we try to use a component directly that is not part of a module, we will get the following error: Unhandled Promise...
Read more >Creating a Library in Angular 6 using Angular CLI and ng ...
example-ng6-lib we want to be able to import it like a library and not just another set of files that are part of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe I found a solution for the problem. More details can be found here: https://youtrack.jetbrains.com/issue/WEB-28091#u=1527499821194 https://blog.jetbrains.com/webstorm/2018/02/webstorm-2018-1-eap-181-3741/
So adding tsconfig.lib.json to the patterns, seems to work for me.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.