Skip to content

CLI do not think about new property of interface #5976

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

Closed
MISTERSOFT opened this issue Apr 15, 2017 · 3 comments
Closed

CLI do not think about new property of interface #5976

MISTERSOFT opened this issue Apr 15, 2017 · 3 comments

Comments

@MISTERSOFT
Copy link

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0
node: 6.9.1
os: win32 x64
@angular/common: 4.0.2
@angular/compiler: 4.0.2
@angular/core: 4.0.2
@angular/forms: 4.0.2
@angular/http: 4.0.2
@angular/platform-browser: 4.0.2
@angular/platform-browser-dynamic: 4.0.2
@angular/router: 4.0.2
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.2

Repro steps.

  1. ng new simple_project
  2. ng serve
  3. ng g service TestService
  4. Create an exportable interface in an other file : ITest with a property first
  5. Implement the ITest interface in TestService
  6. Inject the TestService into the AppComponent constructor
  7. Import the interface created into the AppComponent
  8. Create a new instance of the TestService and store the instance into a variable of type ITest (this is useless but into an other project I'm using interface to use some services)
  9. Make a console.log of the property first from the variable of type ITest (that will work)
  10. Save all changes and wait the compilation
  11. Create a new property into the ITest interface (e.g: second)
  12. In the AppComponent, make a console.log of the property second from the variable of type ITest
  13. Save changes
  14. Compilation error appears

The log given by the failure.

ERROR in F:/Projets/Web/simple_project/src/app/app.component.ts (60,19): Property 'second' does not exist on type 'ITest'.

Mention any other details that might be useful.

If we shutdown the CLI and restart with an ng serve that will compile fine and the error disappears.

@BobBDE
Copy link

BobBDE commented Apr 16, 2017

Yeah I have the same problem since angular cli since 1.0.0-rc.1

Related issue #5404

@filipesilva
Copy link
Contributor

This is actually a dupe of #2034 I believe. There's some problems with interfaces in Webpack.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants