question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generation of library produces tslint error like "'Component' is not included in a module"

See original GitHub issue

Versions

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 image TypeScript config: image

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:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
multimike77commented, Jun 14, 2018

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.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 9, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found