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.

Support project references / solution-style configs (common in Nx projects)

See original GitHub issue

Issue Type: Bug

Recently, I can no longer get suggestions of Angular HTML attributes and variable suggestions. Also, it no longer shows errors as it used to such as when I bound to a non-existant variable. So basically I have no Angular support in my HTML templates any longer.

Extension version: 0.1000.7
VS Code version: Code - Insiders 1.48.0-insider (c9a2f78283b6e5ef708fb8869e2a5adaa476e42f, 2020-07-31T07:35:12.881Z)
OS version: Darwin x64 19.6.0

Angular CLI: 10.0.4
Node: 12.18.1
OS: darwin x64

Angular: 10.0.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.4
@angular-devkit/build-angular     0.1000.4
@angular-devkit/build-optimizer   0.1000.4
@angular-devkit/build-webpack     0.1000.4
@angular-devkit/core              10.0.4
@angular-devkit/schematics        10.0.4
@angular/cdk                      10.1.1
@angular/cli                      10.0.4
@angular/material                 10.1.1
@ngtools/webpack                  10.0.4
@schematics/angular               10.0.4
@schematics/update                0.1000.4
rxjs                              6.6.0
typescript                        3.9.7
webpack                           4.43.0
System Info
Item Value
CPUs Intel® Core™ i7-7700HQ CPU @ 2.80GHz (8 x 2800)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 18, 6, 4
Memory (System) 16.00GB (0.01GB free)
Process Argv -psn_0_2732699
Screen Reader no
VM 0%

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

21reactions
pstarostka-zzcommented, Aug 3, 2020

I think I found a workaround of sorts… In the lib, change tsconfig.json from something like this:

{
  "extends": "../../tsconfig.base.json",
  "files": [],
  "include": [],
  "references": [
    {
      "path": "./tsconfig.lib.json"
    },
    {
      "path": "./tsconfig.spec.json"
    }
  ],
}

to something like this:

{
  "extends": "../../tsconfig.base.json"
}

tsconfig.lib.json and tsconfig.spec.json for the lib should extend the tsconfig.json you modified - so basically no changes there

Here’s my tsconfig.lib.json for reference:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "../../dist/out-tsc",
    "target": "es2015",
    "declaration": true,
    "inlineSources": true,
    "types": [],
    "lib": ["dom", "es2018"]
  },

  "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
}

Hope this helps!

6reactions
kpaxtoncommented, May 4, 2021

I’m having this same issue with an NX 12 workspace and Angular 11.2+. The Language service does not pick up configured paths in the tsconfig.base.json. NX is aware of the issue and doesn’t believe they have the ability to fix this problem. https://github.com/nrwl/nx/issues/3342

Is there something that the language service can be given a glob or file pointer to include for suggestions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project Configuration - Nx
Projects can be configured in package.json (if you use npm scripts and not Nx executors) ... Nx merges the two files to get...
Read more >
More customizable workspaces, Angular 10 support, Better ...
Addition of styled-jsx support for components, apps, and libraries. · Custom babel configuration per project in an Nx workspace. · Support for ...
Read more >
Using TypeScript project references in NX | by Jake Ginnivan
We use TypeScript project references, and run tsc -b --watch in a vscode task to ... to create new NX projects which have...
Read more >
customizable workspaces, Angular 10 support, Better WebStorm
Solution-style tsconfigs are a new feature of TypeScript that allows the IDE to use specific tsconfig files for references to different files. Previously,...
Read more >
The ultimate migration guide to angular-eslint, ESLint and Nx 11
Generate an Angular application project. Because of our generators configuration, Angular application and library projects will be generated ...
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