Skip to content

Angular CLI doesn't detect changes/references in files used by importing 'index.ts' in angular and don't recompiling project #13975

Closed
@zwiras

Description

@zwiras

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No

Description

In AppComponent the IPerson1 interface is imported by index. Probably visual studio doesn't detect references to the file and doesn't recompile the project when changing and saving the file. The interface "IPerson2" is imported directly and recompile works.

🔬 Minimal Reproduction

  1. Create Angular project
  2. Add new folder "person"
  3. Add file iperson1.ts to "person" folder
export interface IPerson1 {
  name: string;
  age: number;
}
  1. Add file IPerson2 to "person" folder
export interface iperson2.ts {
  name: string;
  age: number;
}
  1. Add ile index.ts to "person" folder
export * from './iperson';
export * from './iperson2';
  1. Add this code to AppComponent:
import { IPerson1 } from './person';
import { IPerson2 } from './person/iperson2';
  person: IPerson1 = {
    age: 20,
    name: 'Karl'
  };

  person2: IPerson2 = {
    age: 21,
    name: 'Tomas'
  };
  1. Start project: npm start
  2. Change something in iperson1.ts and save. Project is not recompiled.
  3. Change something in iperson2.ts and save. Project is recompiled.

vscode2

🌍 Your Environment


Angular CLI: 7.3.3
Node: 10.15.1
OS: win32 x64
Angular: 7.2.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.3
@angular-devkit/build-angular     0.13.3
@angular-devkit/build-optimizer   0.13.3
@angular-devkit/build-webpack     0.13.3
@angular-devkit/core              7.3.3
@angular-devkit/schematics        7.3.3
@angular/cli                      7.3.3
@ngtools/webpack                  7.3.3
@schematics/angular               7.3.3
@schematics/update                0.13.3
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0

Anything else relevant?

  • VSCode Version: 1.31.1
  • OS Version: Windows_NT x64 10.0.17134

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions