{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/11060","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/11060/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/11060/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/11060/events","html_url":"https://github.com/angular/angular-cli/issues/11060","id":327372433,"node_id":"MDU6SXNzdWUzMjczNzI0MzM=","number":11060,"title":"\"[WDS] Disconnected!\" error on new Angular 6 project","user":{"login":"Jawan81","id":2676286,"node_id":"MDQ6VXNlcjI2NzYyODY=","avatar_url":"https://avatars3.githubusercontent.com/u/2676286?v=4","gravatar_id":"","url":"https://api.github.com/users/Jawan81","html_url":"https://github.com/Jawan81","followers_url":"https://api.github.com/users/Jawan81/followers","following_url":"https://api.github.com/users/Jawan81/following{/other_user}","gists_url":"https://api.github.com/users/Jawan81/gists{/gist_id}","starred_url":"https://api.github.com/users/Jawan81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jawan81/subscriptions","organizations_url":"https://api.github.com/users/Jawan81/orgs","repos_url":"https://api.github.com/users/Jawan81/repos","events_url":"https://api.github.com/users/Jawan81/events{/privacy}","received_events_url":"https://api.github.com/users/Jawan81/received_events","type":"User","site_admin":false},"labels":[{"id":957896443,"node_id":"MDU6TGFiZWw5NTc4OTY0NDM=","url":"https://api.github.com/repos/angular/angular-cli/labels/comp:%20devkit/build-angular","name":"comp: devkit/build-angular","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-29T15:27:14Z","updated_at":"2018-07-23T21:35:54Z","closed_at":null,"author_association":"NONE","body":"After upgrading my Angular 5.2 app to 6.0 the connection to the Webpack Dev Server could not be established anymore (\"[WDS] Disconnected!\"). I then verified that the same problem occurs on a newly created project as well.\r\n\r\n### Versions\r\n```\r\nAngular CLI: 6.0.5\r\nNode: 8.9.1\r\nOS: linux ia32\r\nAngular: 6.0.3\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... http, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\nPackage                           Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect         0.6.5\r\n@angular-devkit/build-angular     0.6.5\r\n@angular-devkit/build-optimizer   0.6.5\r\n@angular-devkit/core              0.6.5\r\n@angular-devkit/schematics        0.6.5\r\n@angular/cli                      6.0.5\r\n@ngtools/webpack                  6.0.5\r\n@schematics/angular               0.6.5\r\n@schematics/update                0.6.5\r\nrxjs                              6.2.0\r\ntypescript                        2.7.2\r\nwebpack                           4.8.3\r\n\r\n```\r\n\r\nUbuntu 16.04 Vagrant VM running under Windows 10.\r\nPort 4200 is forwarded in the Vagrantfile:\r\n`config.vm.network \"forwarded_port\", guest: 4200, host: 4200`\r\n\r\n### Repro steps\r\n<!--\r\nSimple steps to reproduce this bug.\r\nPlease include: commands run, packages added, related code changes.\r\nA link to a sample repo would help too.\r\n-->\r\n* Step 1: `ng new blabla` in the VM\r\n* Step 2: `ng serve --host 0.0.0.0 --port 4200 --disable-host-check`\r\n* Step 3:  Open `http://<ip-of-my-vm>:4200` in the host's browser (Firefox and Chrome tested)\r\n* Step 4: The page loads successfully, but `[WDS] Disconnected!` appears in the browser's console\r\n\r\n\r\n### Observed behavior\r\nAs similar [WDS] problems seem to have struggled a lot of people in the past I tried to follow their advices but never found something to solve it.\r\nTo narrow down the error I created a new project to see if the error persists - and it does.\r\n\r\nWhen I follow the above steps the [WDS] Disconnected! error occurs and live updates don't work. \r\nI have stepped through what is happening before that error and noticed that SockJS cannot establish a connection because all its 'transport' mechanism return 'disabled'.\r\nFor example in SockJS's `sockjs-client/lib/transport/websocket.js` you find this:\r\n```\r\n...\r\nWebsocketDriver = require('./driver/websocket'); // should include faye-websocket\r\n...\r\nWebSocketTransport.enabled = function() {\r\n  return !!WebsocketDriver; // will return false\r\n};\r\n```\r\nBut `WebsocketDriver` is `undefined` although Websockets are supported by the browsers I use (FF 60, Chrome 66). \r\nThe other transport mechanisms of SockJS also return `false` when `enabled` is requested on them so SockJS has no valid transport mechanism left and closes the connection before any request has been made which then causes the output of `[WDS] Disconnected!`.\r\n\r\n### Desired behavior\r\n<!--\r\nWhat would like to see implemented?\r\nWhat is the usecase?\r\nWhat did you expect to see?\r\n-->\r\nAs I had no problems with the dev server in my setup when using Angular 4 or 5 I would have expected the `ng serve` command to still work the way it has. \r\nBut something must have changed in either the webpack dev server, SockJS, faye-websocket or the angular cli that now makes this error pop up. I unfortunately couldn't find out what.\r\n\r\n### Mention any other details that might be useful (optional)\r\n\r\nI also tried out if there's a difference when using nginx as a reverse proxy instead of using the VM's forwarded port, but there isn't...\r\n\r\nfyi: For the Angular 5.2 project I used the same version of node"},"comment":{"url":"https://api.github.com/repos/angular/angular-cli/issues/comments/407209016","html_url":"https://github.com/angular/angular-cli/issues/11060#issuecomment-407209016","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/11060","id":407209016,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzIwOTAxNg==","user":{"login":"antonevane","id":91357,"node_id":"MDQ6VXNlcjkxMzU3","avatar_url":"https://avatars1.githubusercontent.com/u/91357?v=4","gravatar_id":"","url":"https://api.github.com/users/antonevane","html_url":"https://github.com/antonevane","followers_url":"https://api.github.com/users/antonevane/followers","following_url":"https://api.github.com/users/antonevane/following{/other_user}","gists_url":"https://api.github.com/users/antonevane/gists{/gist_id}","starred_url":"https://api.github.com/users/antonevane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonevane/subscriptions","organizations_url":"https://api.github.com/users/antonevane/orgs","repos_url":"https://api.github.com/users/antonevane/repos","events_url":"https://api.github.com/users/antonevane/events{/privacy}","received_events_url":"https://api.github.com/users/antonevane/received_events","type":"User","site_admin":false},"created_at":"2018-07-23T21:35:54Z","updated_at":"2018-07-23T21:35:54Z","author_association":"NONE","body":"Angular CLI 6.1.X moved back to webpack 4.6.0.\r\n 4.6.0 [SOLVED] reloading issue\r\n    `\"devDependencies\": {\r\n    .....\r\n    \"webpack\": \"4.6.0\"\r\n  }`"}}
{"actor":{"display_login":"antonevane"}}