Skip to content
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

Code editor does not recognize declaration of paths #73

Closed
oliamb opened this issue Oct 24, 2017 · 10 comments
Closed

Code editor does not recognize declaration of paths #73

oliamb opened this issue Oct 24, 2017 · 10 comments
Labels

Comments

@oliamb
Copy link

oliamb commented Oct 24, 2017

Thanks for a great initiative, I can't wait to use it on my project!

Everything is working so far, including AOT compilation and tests, except for an annoying issue in Code editor where all my template are reporting errors because some components cannot be looked up. To be exact, all the components that are imported using one of the rules defined in tsconfig paths attribute.

I think this issue is reported since a long time: angular/angular#16382

I can confirm that the compilation and the test successfully run but all my templates and Component are red in MS Code editor.
Is this is a known issue that I should either wait for a fix or fix it myself?

But maybe it is just my configuration that is messed up? Do you know of any workaround to have it working?

Also, I can also reproduce it with a simpler project, just relying on paths in tsconfig seems to break angular language service.

@sandangel
Copy link

I think until that issue is fixed, you can add CUSTOM_ELEMENTS_SCHEMA like the editor suggest.

@oliamb
Copy link
Author

oliamb commented Oct 25, 2017

@sandangel I agree, your proposal would remove the red.

I am not sure I want to do that because typechecking in templates is working quite well right now and I am not ready to give it up. What worries me is that nobody has acknowledged the issue and seems to be working on it as it is still broken in Angular 5 beta. I fear a bit that it will remain like this for a long time.

@sandangel
Copy link

I'm sure you would want to use Polymer 3.0 custom element in your Angular App, It's really great. and you have to add CUSTOM_ELEMENTS_SCHEMA to enable it.

@vsavkin
Copy link
Member

vsavkin commented Oct 31, 2017

This is an issue with the angular language service, we cannot fix it on our side. You can disable the language service for now.

@ghost
Copy link

ghost commented Dec 1, 2017

Thought that angular/angular#20222 would fix this issue also for nx. However I still got the same error. Do you have any news about this? I really don't want to disable language service.

@blacksand
Copy link

blacksand commented Jan 11, 2018

@davidwuerfel before the vscode angular language service fix this issue, you can use 'yarn link' to help language service find the library path.

  1. cd libs/my-lib
  2. yarn init enter package name like @my-scope/my-lib
  3. yarn link
  4. cd ../..
  5. yarn link @my-scope/my-lib

restart vscode, angular language service should be works.

@ghost
Copy link

ghost commented Jan 11, 2018

Thank you very much. Already made my day! This indeed works for the time being.

@ghost
Copy link

ghost commented Mar 8, 2018

FYI: This has been fixed with newer versions of VSCode Language Service Extension. Tested it with v0.1.9. It is now working as expected. (angular/vscode-ng-language-service#211)

@mj-meyer
Copy link

mj-meyer commented Mar 7, 2019

FYI: I was still experiencing this issue. Seems you need to reload the editor each time you add a new lib. Unless it's just my environment that's whack. Although, I figured since you need to serve again after adding a lib, maybe you need to reload the editor as well. So I guess it would make sense?

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants