Closed HarelM closed 6 years ago
i fix this error with
ng build --prod --aot=false
I guess this might work but it is a workaround, and assumes I don't want to AoT my code.
@HarelM Angular cli build your code AoT to default. with --aot=false
flag we say to angular cli dont Aot our code.
I fully understand the flag :) but it should still not emit duplicate errors when this flag is not specified...
@HarelM Do you have code somewhere in repo replicating the issue?
Any typescript compilation error. I have a repository but I think it's too complicated...
This one should do - getting the following errors when running ng build --prod
:
ERROR in ng:///D:/Github/IsraelHikingMap/Issue17039/IsraelHiking.Web/sources/application/components/routeStatistics.html (13,5): Property 'thisMethodDoesNotExistInFile' does not exist on type 'RouteStatisticsComponent'.
ERROR in ng:///D:/Github/IsraelHikingMap/Issue17039/IsraelHiking.Web/sources/application/components/routeStatistics.html (14,5): Property 'thisOneEither' does not exist on type 'RouteStatisticsComponent'.
ERROR in ng:///D:/Github/IsraelHikingMap/Issue17039/IsraelHiking.Web/sources/application/components/routeStatistics.html (13,5): Property 'thisMethodDoesNotExistInFile' does not exist on type 'RouteStatisticsComponent'.
ERROR in ng:///D:/Github/IsraelHikingMap/Issue17039/IsraelHiking.Web/sources/application/components/routeStatistics.html (14,5): Property 'thisOneEither' does not exist on type 'RouteStatisticsComponent'.
I can verify I also get double errors. Using windows, and adding the following code to src/app/app.component.ts
:
interface SomeInterface {
prop: number;
}
const impl: SomeInterface = {prop: 42}
impl.anotherProp = 43;
Results in:
kamik@T460p MINGW64 /d/sandbox/master-project (master)
$ ng build
Hash: 399ec6f4fb67d11884d2
Time: 8894ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 157 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.js.map (main) 60.5 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 65.2 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 1.81 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
ERROR in D:/sandbox/master-project/src/app/app.component.ts (17,6): Property 'anotherProp' does not exist on type 'SomeInterface'.
ERROR in D:/sandbox/master-project/src/app/app.component.ts (17,6): Property 'anotherProp' does not exist on type 'SomeInterface'.
Doesn't seem to need to be an AOT error on a template for me.
Just another data point - I am seeing this issue, but not on Windows - my app is running on Ubuntu linux, and occurs when just doing ng s
. Adding the --aot=false flag removed the duplicated.
This happens in one project, but not another, so am unsure the root cause...
I can also see this in the tests I'm running (ng test
) - when a test fails the failure is duplicated.
Chrome 59.0.3071 (Windows 10 0.0.0) RouteStatisticsService Should return 0 distance for statistics not on route FAILED
Expected 0 not to be 0.
at Object.<anonymous> (http://localhost:9876/_karma_webpack_/main.bundle.js:1813:30)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2799:26)
at ProxyZoneSpec.webpackJsonp.../../../../zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/vendor.bundle.js:38496:39)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2798:32)
Chrome 59.0.3071 (Windows 10 0.0.0) RouteStatisticsService Should return 0 distance for statistics not on route FAILED
Expected 0 not to be 0.
at Object.<anonymous> (http://localhost:9876/_karma_webpack_/main.bundle.js:1813:30)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2799:26)
at ProxyZoneSpec.webpackJsonp.../../../../zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/vendor.bundle.js:38496:39)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/_ka
Running on Windows, errors are shown twice on our Angular 4 project too. Adding --aot=false doesn't solve the issue.
The following command results in errors shown twice:
ng build --aot=false
Running ng --version
gives the following output:
@angular/cli: 1.3.2 node: 6.10.2 os: win32 x64 [...] @angular/core: 4.4.6
Absolutely not a dealbreaker, but it can be somewhat confusing.
I'm closing this as solved in newer versions. 1.6.3
shows only one error for my reproduction in https://github.com/angular/angular-cli/issues/6468#issuecomment-305207691.
@ArjanKw you're using a fairly old version that does not have the fix. If you update it should go away.
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.
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.0.4 node: 6.10.3 os: win32 x64 @angular/common: 4.1.3 @angular/compiler: 4.1.3 @angular/core: 4.1.3 @angular/forms: 4.1.3 @angular/http: 4.1.3 @angular/platform-browser: 4.1.3 @angular/platform-browser-dynamic: 4.1.3 @angular/router: 4.1.3 @angular/animations: 4.1.3 @angular/material: 2.0.0-beta.5 @angular/flex-layout: 2.0.0-beta.8 @angular/cli: 1.0.4 @angular/compiler-cli: 4.1.3
Repro steps.
Not sure, in my case it allways happens - error are emitted twice:
The log given by the failure.
no crash - no stack strace
Desired functionality.
Each error should be written once.
Mention any other details that might be useful.
I'll be surprised if I'm the first to see this, but I couldn't find another issue on this.