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

add option to exit ng serve on error #27309

Closed
robertIsaac opened this issue Mar 18, 2024 · 5 comments
Closed

add option to exit ng serve on error #27309

robertIsaac opened this issue Mar 18, 2024 · 5 comments

Comments

@robertIsaac
Copy link

Command

serve

Description

right now we are facing a big problem in our e2e pipeline because of #27167
it's even worse when it happen with serve than build, because it doesn't exit and the e2e never run and the pipeline stuck for hours till someone notice it and kill it manually or it timeout
it's wasting us a lot of time and resources, at least it should exit when it fails

Describe the solution you'd like

add option similar to --exit-on-error or even better a production flag --ci so that it disable the watch for file changes, make it exit on error and do any needed optimization for this use case

Describe alternatives you've considered

I can't think of any
if someone has a workaround for this please share

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Mar 18, 2024

I'm a little puzzled about why you're running ng serve in your CI setup. However, if you still need to do so, you can disable file watching to ensure the process terminates upon encountering an error.

ng serve --no-watch

Check out the document to see all available options: https://angular.io/cli/serve

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2024
@robertIsaac
Copy link
Author

hi @alan-agius4
I don't see --no-watch option in https://angular.io/cli/serve, I guess it's undocumented option, but anyway it doesn't make the application exit, it still stuck if it encounter an error

nx s --no-watch

> nx run web-app:serve:dev --no-watch


Warning: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.

Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disable-host-check" if that's the
case.
    
\ Building...X [ERROR] TS6133: 'visiblePrice' is declared but its value is never read. [plugin angular-compiler]

    packages/web/src/app/widgets/price-chart-widget/utils/forward-curves.util.ts:108:2:
      108 │   visiblePrice: PriceTypes,
          ╵   ~~~~~~~~~~~~


X [ERROR] TS6133: 'symbol' is declared but its value is never read. [plugin angular-compiler]

    packages/web/src/app/widgets/price-chart-widget/utils/forward-curves.util.ts:109:2:
      109 │   symbol: string,
          ╵   ~~~~~~


X [ERROR] TS6133: 'prices' is declared but its value is never read. [plugin angular-compiler]

    packages/web/src/app/widgets/price-chart-widget/utils/forward-curves.util.ts:110:2:
      110 │   prices: Map<string, PhysicalPriceEntry>,
          ╵   ~~~~~~


X [ERROR] TS6133: 'fillType' is declared but its value is never read. [plugin angular-compiler]

    packages/web/src/app/widgets/price-chart-widget/utils/forward-curves.util.ts:111:2:
      111 │   fillType: TimeSeriesFillType,
          ╵   ~~~~~~~~


Application bundle generation failed. [86.325 seconds]

about our CI setup, we are using nx which has "devServerTarget": "web-app:serve:e2e" which depend on the serve command of Angular to run the application before the cypress test start
how do you suggest to run the e2e test otherwise?

@robertIsaac
Copy link
Author

update, trying it in a brand new angular 17 application, it does exit
it seems nx issue

@alan-agius4
Copy link
Collaborator

All Boolean options can be negated using the -—no prefix.

See https://angular.io/cli#boolean-options

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants