google / google/aside

The Angular Language Server uses `/tsconfig.json` instead of only `/src/ui/tsconfig.json`

Open
#50 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
441
Forks
13
PR merge metrics
No merged PRs in 30d

Description

The Angular Language Server uses `/tsconfig.json` instead of only `/src/ui/tsconfig.json`, resulting in it not resolving imports from modules in `/src/ui/node_modules`.

I'm not quite sure what all the implications of this issue might be, but in my case, this resulted in the Angular extension for Visual Studio Code reporting:

> `mat-divider` is not a known element:
> 1. If `mat-divider` is an Angular component, then verify that it is included in the `@Component.imports` of this component.
> 2. If `mat-divider` is a Web Component then add `CUSTOM_ELEMENTS_SCHEMA` to the `@Component.schemas` of this component to suppress this message.
> app.ts(18, 16): Error occurs in the template of component App.

when trying to use an imported component in my template, and also:

> Some language features are not available. To access all features, enable [strictTemplates](https://angular.dev/reference/configs/angular-compiler-options#stricttemplates) in [angularCompilerOptions](https://angular.dev/reference/configs/angular-compiler-options).

In order to fix this, `/src/ui` can be excluded from `/tsconfig.json`.

Contributor guide

Open the contributing guide

Research direction

Inspect /tsconfig.json and /src/ui/tsconfig.json first, then reproduce the Angular Language Server behavior in the Visual Studio Code Angular extension. Verify that the configuration uses only the UI project context, imports from /src/ui/node_modules resolve, and the reported template diagnostics are no longer produced.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript, vscode
Domain
frontend, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.