Skip to content
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

Ctrl + C is not working dev-server with SSR #28336

Open
1 task done
helloaliimran opened this issue Sep 3, 2024 · 4 comments
Open
1 task done

Ctrl + C is not working dev-server with SSR #28336

helloaliimran opened this issue Sep 3, 2024 · 4 comments

Comments

@helloaliimran
Copy link

helloaliimran commented Sep 3, 2024

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

17

Description

The Ctrl+C command is not working to stop the application from the terminal.

Minimal Reproduction

I face this problem after updating angular material : ng update @angular/material

Exception or Error

No response

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 18.2.2
Node: 20.11.1
Package Manager: npm 9.8.1
OS: win32 x64

Angular: 18.2.2
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, platform-browser-dynamic
... platform-server, router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.2
@angular-devkit/build-angular   18.2.2
@angular-devkit/core            18.2.2
@angular-devkit/schematics      18.2.2
@schematics/angular             18.2.2
rxjs                            7.8.1
typescript                      5.4.3
zone.js                         0.14.10

Anything else relevant?

No response

@alan-agius4
Copy link
Collaborator

Are you using the vite based dev-server with ssr?

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Sep 3, 2024
@helloaliimran
Copy link
Author

vite based dev-server

no I am using simple VS Code compiler, and yes SSR is enable.

@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity5: regression area: @angular/build angular/build:dev-server and removed needs: more info Reporter must clarify the issue labels Sep 3, 2024
@alan-agius4
Copy link
Collaborator

I'm not entirely sure what you mean by "VS Code compiler" in this context. You can either be using the Webpack or Vite based dev-server. Given that you're using SSR and encountering this issue, it's probable that you're working with the Vite dev server.

This is a known issue in this case, and is appears to be caused zone.js. As a workaround, you can use q + <enter>.

//cc @JiaLiPassion

@alan-agius4 alan-agius4 changed the title Ctrl + C is not working Ctrl + C is not working dev-server with SSR Sep 3, 2024
@anisabboud
Copy link

Encountering the same issue for the past couple of weeks... (Angular 18.2 with Vite/SSR, WSL shell)
ng serve => Ctrl + C sometimes works, and oftentimes stops working; especially when there's a console log.

Reproduction

  1. app.component.tsconstructor() { console.log('hello'); }
  2. ng serve
  3. Navigate to http://localhost:4200
  4. hello will be printed to the terminal, and after that Ctrl + C doesn't work
    image

Workarounds

Ctrl + D or q + <enter> work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@anisabboud @helloaliimran @alan-agius4 and others