I am using the baseUrl option in tsconfig.json. However the plugin reports an error with the following message:
Error encountered resolving symbol values statically. Could not resolve services/system.service relative to /Users/mc/code/courseapp/src/pages/course/course.page.ts.
Additionally the error is marked 5 lines down from where the actual import takes place.
Hi,
This is an awesome plugin... thanks!
I am having the same problem though where I am combining 'baseUrl' with the 'paths' property to point to an external module at the same level as my main project. I have this in my tsconfig...
"baseUrl": ".",
"paths": {
"@shared/*": [ "./Shared/*" ]
}
In my html I am getting the error that one of my shared components isn't a known element.
Thanks, Simon
Can either of you produce a small repository that reproduces this problem?
ok, i did setup a blank project via angular-cli and could reproduce the bug there: https://github.com/metzc/vscode-ng-language-service-baseUrl-bug
By implementing the example another issue popped up that i suspect to be connected to the same problem:
Component 'NewCmpComponent' is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration
You can see the error messages when you open the file 'src/app/new-cmp/new-cmp.component.ts'.
Only one error shows up at a time, both are visually connected to the @Component decorator on line 5. If you "fix" the import of MyNewServiceService by making it relative, the error from above will be shown. This one in turn can be "fixed" by making the import of the component in app.module.ts relative.
What i found out already that the error connected to the service import only appears when the service is actually injected in the component.
Sometimes you need to reload the editor window to make the error appear/disapper (for me when i change app.module.ts).
Hi,
I have also encountered the problem @metzc reported.
Tracking in Angular https://github.com/angular/angular/issues/15974
@chuckjaz I see this is fixed now in language-service angular/angular#15974, but guess there need to be a new release of this component before the fix lands in VSCode?
Commenting to raise more awareness. Hoping to see this fix rolled into the extension soon.
(Especially now that John Papa is promoting this in the "Angular Essentials" pack)
Fixed in 0.1.4
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._
Most helpful comment
Fixed in 0.1.4