19

I use Angular and i get console error only on Firefox "[WDS] Disconnected!".

Firefox console error message is here

Here is my Angular-Cli version.

Angular CLI: 6.0.1
Node: 8.11.1
OS: win32 x64
Angular: 6.0.1
... cli, common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.1
@angular-devkit/build-angular     0.6.1
@angular-devkit/build-optimizer   0.6.1
@angular-devkit/core              0.6.1
@angular-devkit/schematics        0.6.1
@angular/animations               6.0.4
@ngtools/webpack                  6.0.1
@schematics/angular               0.6.1
@schematics/update                0.6.1
rxjs                              6.2.0
typescript                        2.7.2
webpack                           4.6.0
mehmetdemiray
  • 976
  • 4
  • 13
  • 32

2 Answers2

16

Solved it today by running npm update. Apparently it was a bug with an older version of Webpack.

bluppfisk
  • 2,538
  • 3
  • 27
  • 56
9

This error appeared again for me under angular 7.2.1.

The solution was to add the following line in angular.json under architect>serve>options:

"disableHostCheck": true
Fredrik_Borgstrom
  • 2,504
  • 25
  • 32
  • 3
    @BlackFox This applies to the internal server which by itself is a security risk and very clearly announced as such by the CLI, so it's like saying that adding menthol flavor to a cigarette is a health risk. – Fredrik_Borgstrom Nov 09 '19 at 10:59
  • I like your comment even though i dont fully understand how an internal server is a security risk. I was hope to point out “kids...dont smoke cigarettes....even if they add mint flavor to it. Learn about the health risk first”. Every other post on StackOverflow about “disableHostCheck” set to true says “ this is.a security risk”. I will venture to understand why this weekend. – BlackFox Nov 09 '19 at 16:45
  • 3
    The builtin server shouldn't be used in production because it hasn't been tested for security. It's just for development and should be inaccessible to the outside world. Hence setting disablehostcheck to true doesn't matter in a context which already is insecure. – Fredrik_Borgstrom Nov 10 '19 at 14:03
  • Besided the fix, can anyone explain why this error appears? – csg Oct 14 '21 at 09:44