-
Notifications
You must be signed in to change notification settings - Fork 12k
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
keep get [WDS] disconnected! #4839
Comments
@luzly have you tried to reset Chrome settings to defaults? |
I have the same problem (in Chrome 56), but it only happens when I use Versions |
I had the exact same issue - when using SSL. What was happening is that the WebSocket would get closed/dropped with a handshake error. (I could see the error in Chromium, but not Chrome). In my case the certificate that the "webpack-dev-server" is using is self-signed and so I had the option "chrome://flags/#allow-insecure-localhost" enabled to ignore the "page not secured" message. Installing the certificate in Chrome as Trusted Root fixed the "[WSD] Disconnected!" issue. I got the certificate from "\node_modules\webpack-dev-server\ssl" and extracted it manually from the file then imported in Chrome and disabled the "allow-insecure-localhost". Importing the certificate via MMC didn't work for me - I had to do it in Chrome. (This is on Windows 7) |
Closing as answered, thanks @violinbg ! |
I still receive the |
@violinbg Can you give more step by step guide to do that extraction etc to get around this? |
With some of the recent updates of Chrome, the browser now rejects certificates that don't have SAN (Subject Alternative Name). If the cert doesn't have the "Subject Alternative Name" - you need to figure out how to create a new self-signed cert with SAN - I googled for a while and it wasn't as easy as I hoped. So double check the certificate you are using has that, then install it to Chrome via Settings -> Show Advanced -> Manage Certs -> Then add it to "Trusted Root..."; (after that make sure all "chrome.exe" processes are closed/restarted - or change won't have effect) You can also play with the "chrome://flags/#allow-insecure-localhost" option in Chrome or disable SSL in Angular. I hope this helps somewhat. As I pointed earlier - I had the issue because I was using HTTPS . If you are not or you still have the issue - I would suggest to download Chromium - you'll see more error messages in the Console Log - so it may help to figure out exactly what's happening. PS: For the extraction of the certificate. In \node_modules\webpack-dev-server\ssl open the file "server.pem" and copy the text between BEGIN/END CERTIFICATE; Paste in new file and name it SOMENAME.CRT; You can then install that in Chrome. (I'm not sure anymore if that's the cert it uses by default. Angular is changing pretty fast...) |
@violinbg Thanks for the reply. Yes I'm using self signed certificate and need to run app in https, so I need to fix this somehow. I will investigate this more with your instructions. Thanks |
Im still having this problem on win/chrome and also mac safari. Any of those tips mentioned earlier did not work for me. |
Updating to chrome 59 seems to work on Mac and Windows. |
I am still seeing this issue in Chrome 59. It seems to go away when disabling SSL on ng serve. |
@hill0826 Hmm...verify you run latest angular? and angular cli. |
@veke good question. yes, here's the output of
I'm on Windows 10 and Chrome 59. We don't have a strong requirement for SSL in development environments right now so we're going to disable it for the time-being, but it would be nice to have. This issue seems to relate to webpack/webpack-dev-server#941 and potentially webpack/webpack-dev-server#851. |
@hill0826 Strange, I have angular 4.2.2 and cli 1.1.2 on mac and works for me. And on windows 7 chrome 59 works for me too. (don't have access to see exact module versions, but are quite similar) |
I have the latest CLI version and Chrome 59 installed and I still have the issue but not as often as with previous version of Chrome and CLI. |
Do you guys have a green bar(indicator for the cert) in Chrome when you have the redirect issue? If you don't it's most certainly a SSL issue. You can see the actual error in the console log if you try with Chromium. It would probably be something like "SSL handshake failed". Last time I had the issue was with the latest Chrome version refusing to accept self-signed certificates with no SAN. The certificate that comes with the "webpack-dev-server" doesn't have SAN. So I created a new cert with SAN and it's working fine at this time. |
@violinbg Do you have some easy guide to create self signed cert with SAN? |
@veke: |
@veke
This seems to have fixed it for me; included a PR |
@cwalv Thanks. I will test this. |
@cwalv |
@veke, I made my a cert with the PowerShell command New-SelfSignedCertificate, but it's only available in Windows 10 (and maybe 8). |
@violinbg @cwalv
It is valid for 365 days (default value). |
@veke Thanks! That script will come handy :) |
Edited extension parameters. Removed URI and IP. Still got green certificate. |
i am using nginx but the cert generated by selfsigned(node) not working with my domain https://mydomain.m? some idea?, |
Did you added it in your OS too? |
@veke yes :(, Neither with localhost |
if you have latest browsers and cli installed, I have no idea. This is strange that some work for other and other not. Try to add those IP and URI fields back to script.
I got green certificate with that node script in two machines running OSX (haven't tested on windows yet) |
What is the error in your certificate? In Chrome you need to open your dev-tools and look for security tab. |
@veke this is the error: |
@veke the code for generate cert:
|
I deal this stuff only with local development / angular related stuff. Im not even sure you can use these in real domains :D |
@fernandops26 Certificates are read by the browser. The browser goes to a certification authority to validate the certificate. The certification authority says if the certificate is correct. With a self signed certificate there is no certification authority - so the browser can't trust it. For a local dev environment, you can see its your certificate and so can choose to trust it - but its still not a correct certificate as it's self signed and doesn't have a certification authority associated with it. So the browser raises this ERR_CERT_AUTHORITY_INVALID. The trick (which I still don't know how) is to get the browser to trust the certificate for your dev environment. You shouldn't ever trust a self signed certificate from real server and system admins shouldn't have a self signed certificate on a server to make it work. This is my "basic" understanding of certificates at the moment |
I used @veke code and it worked:
|
[SOLVED] With this reference you can also solve the problem, thanks: |
[SOLVED] run the angular app using |
thanks @abergs for your solution. That worked for me. |
I created file
To me solved! |
@farnetani Are you using Vue? I think you're in a wrong repo. If you could explain and demonstrate that your solution will work in Angular CLI then it would be very much helpful. |
I finally got the issue resolved by simply checking my package.json to see if there's a webpack dependency, in my case, there was none so I ran the following" I hope this helps someone. |
@william-creative-cx |
Hi, As suggested earlier in my case running angular 8 (Ubuntu OS) with "sudo npm start" seems to be working correctly now. BR, |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Windows 10
Versions.
@angular/cli: 1.0.0-beta.32.3 [1.0.0-beta.24]
node: 6.9.1
os: win32 x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-beta.32.3
@angular/compiler-cli: 2.4.8
Repro steps.
The error only appears under Chrome, both version 55 and 56, it works fine in Mircrosoft Edge and other browsers. I've searched the internet, most solution is about webpack, but I don't know how to config this with angular-cli. I wonder whether this is a bug related to Chrome or not, anyway, even a newly created project suffers.
Thank you for help!
The text was updated successfully, but these errors were encountered: