-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component not included in a module warning for all components not in root AppModule #10
Comments
It could be a bug but I am not sure. Can you produce a repository that reproduces this issue? This error is generated when you include a reference to a component that is not included in the the The language service scans the entire project (everything included by the tsconfig.json) for |
Just tried in a new angular-cli project but can't seem to be able to reproduce the issue. Not sure if it's a problem that only affects projects over a certain threshold size/module structure. The project in which I discovered the issue has 12 modules in total:
Will have a further look and play around when I get a chance to see if I can discover at what point this is reproduced. |
I think this might be related to #36 |
I'm still having the same issue with the latest version. I have managed to narrow down one scenario that causes the bug.
When I include the AuthSevice in the CoreModule's providers array and import the CoreModule into the AppModule I get the following errors.
If I comment out the AuthService from the providers array in the CoreModule the errors go away. I've uploaded the example to this repository. Hope this helps track down the problem. |
Tracked as angular/angular#14631. This bug will be closed when the fix for the above lands and a new release of |
This has been fixed in |
Still have the same problem, version 0.1.3 |
Just installed 0.1.3 to check out this plugin. Getting the same error on a project that's working fine. It's also identifying is deprecated (when used for ng-bootstrap components) and should be replaced with . However linting fails when making that change. |
@veldirre Can you create a separate issue and attach a way to reproduce the issue you are having? This issue has been fixed. You are probably running into a different issue that looks similar. |
@jshea I am not sure I understand you issue. Can you open a separate issue and attach a project that reproduces the issue? |
@chuckjaz Are there any debugging methods for investigating this as it occurs? None of my non-route components are recognized as included in the module declaration, but stripping down our production app to a minimal example would be very time consuming (and so far all of the toy versions I've tried to spin up haven't exhibited the problem). I'll keep trying to make a small reproduction, but if there are any other approaches that would help a lot. |
Nevermind. I stumbled upon the problem just a bit after posting: #80. |
@tdsmithATabc The initial cause of original issue of this thread is fixed in the latest version 0.1.3. However, I did notice I was still getting the same error occasionally for some components. After a bit of investigating I realised these remaining errors were being caused by another separate issue #72. Changing references for any services etc... in the offending components to relative paths (as opposed to paths relative to the baseUrl location provided by tsconfig - the "src/" folder by default) seems to act as a workaround in the offending components. Not sure if this is the same issue you have but thought I'd mention it here. |
Ah, just got you last message, nevermind. |
Thanks for the tip regardless! I've had some path struggles as well, but that was because our set-up was using project-relative paths, which are nice for development but terrible for pretty much everything else... |
Upgrading the Angular Language Service from 0.1.2 to 0.1.3 has fixed the issue for me. Thanks! |
I'm using Angular Language Service 0.1.3 and I'm still having this same issue. |
Any news about that thing? |
I was having the same issue Component 'xxxComponent' is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration and while I was researching an reading some threads of pretty much the same issue, the error suddenly (after about 15 minutes) disappeared, I think is more a timing issue when you change/add components |
Still having the issue with 0.1.7 |
Encountering this on 0.1.9. Reproducible by starting new ionic project with the tutorial template and creating a new page which requires the the new page class be declared in the app.module.ts file. I am able to get this to go away by just reopening the project so not the end of the world, but inconvenient. |
Have this issue on 0.1.9 with Directives |
I can confirm the same behavior as @josh-strickland-4c |
I can report this issue with the 0.1.9 version with components. |
bump, same problem in 0.1.9 when using lazy loading modules. If details are needed lmk. |
Still an issue with 2018.2 in a library project (created with angular cli). |
Same for me in Webstorm Project! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Hi,
This is looking very promising, can't wait to use it!
I am however having trouble getting this to recognise components that are declared in feature modules (both lazy-loaded and not). All these components have the following warning (with red squiggles under the component decorator).
[Angular] Component 'xxxComponent' is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration
This means that in templates (the app.component.html template in the root module is the only one) in this module I can get completion etc. to work for directives that are in the same module and imported angular built-in directives. However directives from my own imported modules i get the following.
[Angular] 'app-nav' is not a known element: 1. If 'app-nav' is an Angular component, then verify that it is part of this module. 2. If 'app-nav' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message.
Have i missed something or is this maybe a bug?
I am very excited to use this. It will make my angular 2 coding experience so much better and hopefully save a lot of time, so thanks!
The text was updated successfully, but these errors were encountered: