-
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
Failed to connect to websocket. #29915
Comments
Could the cli build tool not pick up this config option and change the vite config for it ? |
Hi @UmbrellaCrow612, I tried this locally and I was not able to replicate this issue. Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via This might be related to your directory structure so its really important to get an accurate repro to diagnose this. |
@alan-agius4 I made a new angular project using the cli cmd and then put the options i showed above in angular.json and generated certificates using below cmds openssl genpkey -algorithm RSA -out ssl/private.key
openssl req -new -key ssl/private.key -out ssl/csr.csr
openssl x509 -req -in ssl/csr.csr -signkey ssl/private.key -out ssl/certificate.crt Then ran it with But for my project which shows these errors if i just run my front end and not my backend and i dont get the errors and hmr works fine with code changes. But when i run my backend and it is able to make requests to it and i refresh my front end and make code changes i get the error again. hmr dose not auto refresh when i make changes i have to manually fresh and still get errors the repo is at https://github.com/UmbrellaCrow612/PoliceCaseManagement/tree/master/src/web-client you can just run the the the angular proj and generate certificates using the same cmds i did for above with |
@UmbrellaCrow612, there's no need to set I'm still unsure why you're experiencing this issue only when starting the backend server. |
There running on different ports and there both over Https |
@alan-agius4 Are you a able to reproduce it locally ? |
@UmbrellaCrow612, without the backend I am not, and I didn't have time yet to configure .NET. |
Hi @UmbrellaCrow612, I’m still unable to replicate the issue using the project you provided. Here’s what I did: Terminal 1:
Terminal 2:
HMR worked correctly without any errors. In fact, in the network tab, I can see the status code of the WebSocket (WS) protocol switching successfully. ![]() ![]() |
@alan-agius4 Unfortunately don't understand. i tried doing the commands you provided but still am getting the errors. It could be a machine thing or something wrong with my machine ? Did you try making code changes while hmr was running and refreshing ? If you still can't reproduce then i don't want to take to much of your time and you can just close the issue ? |
Which @angular/* package(s) are the source of the bug?
compiler-cli
Is this a regression?
Yes
Description
When running angular over HTPPS following documentation available for example in my
angular.json
i added these options then ran my app throughng serve
It runs on
https://localhost:4200/
which is what i wanted buthmr
failed with errorAnd Hot module reload dose not work. There is a fix on Vite docs following link but there isn't a way for me to use that fix in the angular project as the Vite config is hidden from me ?
What can i do to fix this issue if i cannot change the Vite config ?
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: