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

Prerender should exit with non 0 status code on Error #49954

Closed
knoake opened this issue Apr 20, 2023 · 2 comments
Closed

Prerender should exit with non 0 status code on Error #49954

knoake opened this issue Apr 20, 2023 · 2 comments

Comments

@knoake
Copy link

knoake commented Apr 20, 2023

Which @angular/* package(s) are relevant/related to the feature request?

No response

Description

What
Non 0 status code should be returned when there is an Error during prerender

Why
When there is an error during pre-rendering, the output in the folder dist/browser is not optimal.
If prerender is run by a continuous integration script, it is likely that the error on the console will go unnoticed.

In my case, prerender is run within a GitHub workflow. Because the exit status code is 0, the workflow continues to the next step and deploys the non-rendered files.

For example:
The following error does not result in a non 0 exit code:
ERROR ReferenceError: window is not defined

Proposed solution

A command line argument could be used to give non 0 status codes on error
Alternatively, all errors give a non 0 status code

Alternatives considered

Using grep, it is possible to filter for lines that contain 'ERROR' in the output.
Something like the following might be a starting point for a workaround

npm run prerender |& grep -c ERROR | grep 0
@alan-agius4
Copy link
Contributor

Duplicate of #33642

@alan-agius4 alan-agius4 marked this as a duplicate of #33642 Apr 20, 2023
@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2023
@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 May 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants