Angular-cli: WARNING exported interface not found

Created on 8 Apr 2017  路  5Comments  路  Source: angular/angular-cli

N.B. Already opened issue on angular https://github.com/angular/angular/issues/15800

I'm submitting a ... (check one with "x")

[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
I don't know if this is about angular compiler itself or additional warning from angular cli. I open issue here

I have an exorted interface in src/app/shared/form-utils/localized-input/localized-input.component.ts like:

export interface Language {
  id: number;
  cultureName?: "fr-CH" | "de-CH";
}

And I import this interface inside a component in src/app/shared/form-utils/autocomplete/autocomplete-plan-comptable-element/autocomplete-plan-comptable-element.component.ts I import it like this:
import {Language, LocalizationKey} from "../../localized-input/localized-input.component";
but when I compile (ng serve) I get warning like:

WARNING in ./src/app/shared/form-utils/autocomplete/autocomplete-plan-comptable-element/autocomplete-plan-comptable-element.component.ts
203:50-58 "export 'Language' was not found in '../../localized-input/localized-input.component'

Minimal reproduction of the problem with instructions
read above...

Please tell us about your environment:
windows10, webstorm 2017.1.1

  • Angular version: 2.0.X
@angular/cli: 1.0.0
node: 7.7.2
os: win32 x64
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language:
    typescript 2.2.2 (on webstorm tsc is run and it didn't get me error for this import)

All other import are correct and same and works

Most helpful comment

I keep having this issue as well, its really frustrating as I have to restart the serve every time I add a new interface.

All 5 comments

I keep having this issue as well, its really frustrating as I have to restart the serve every time I add a new interface.

Possible duplicate of #2034.

I'm also having this problem when working with interfaces. Every time I make a change to an interface and ng serve is running, the re-compile fails. Restarting ng serve fixes the issue. It seems as though ng serve caches the interfaces between automatic re-compiles.

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._

Was this page helpful?
0 / 5 - 0 ratings