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

Report which route failed during pre-rendering. #28212

Closed
JeanMeche opened this issue Aug 14, 2024 · 1 comment · Fixed by #28215
Closed

Report which route failed during pre-rendering. #28212

JeanMeche opened this issue Aug 14, 2024 · 1 comment · Fixed by #28215

Comments

@JeanMeche
Copy link
Member

JeanMeche commented Aug 14, 2024

Description

While build a pre-rendered app, I'm greeted with the following error :

Exception:
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ne>".
ERROR

This error makes it hard to investigate the cause as it only happens during pre-rendering (dev mode serve is fine).

It'd be great to have some details, like for example which route is throwing while being pre-rendered.

@alan-agius4 alan-agius4 added needs: more info Reporter must clarify the issue and removed devkit/build-angular:prerender labels Aug 15, 2024
@alan-agius4 alan-agius4 pinned this issue Aug 15, 2024
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Aug 15, 2024
…n occurs during prerendering

This change enhances the error messaging when an unhandled exception occurs during the prerendering process. The updated error message provides more context and clarity.

**Previous Behavior**

```
ng b
An unhandled exception occurred: Some error!!!
See "/tmp/ng-S2ABKF/angular-errors.log" for further details.
```

**Updated Behavior:**
```
ng b
Browser bundles
Initial chunk files     | Names               |  Raw size | Estimated transfer size
main-AFPIPGGK.js        | main                | 218.00 kB |                59.48 kB
polyfills-Z2GOM3BN.js   | polyfills           |  35.82 kB |                11.80 kB
styles-5INURTSO.css     | styles              |   0 bytes |                 0 bytes

                        | Initial total       | 253.82 kB |                71.28 kB

Server bundles
Initial chunk files     | Names               |  Raw size
server.mjs              | server              |   1.11 MB |
chunk-HZL5H5M5.mjs      | -                   | 526.77 kB |
polyfills.server.mjs    | polyfills.server    | 269.91 kB |
chunk-GFWAPST7.mjs      | -                   |  19.16 kB |
chunk-5XUXGTUW.mjs      | -                   |   2.55 kB |
render-utils.server.mjs | render-utils.server |   1.46 kB |
main.server.mjs         | main.server         | 149 bytes |

Lazy chunk files        | Names               |  Raw size
chunk-7YC4RJ5P.mjs      | xhr2                |  12.08 kB |

Prerendered 1 static route.
Application bundle generation failed. [4.923 seconds]

✘ [ERROR] An error occurred while prerendering route '/'.

Error: Some error!!!
    at render (node_modules/@angular/build/src/utils/server-rendering/render-worker.js:20:20)
    at /angular-cli/abc/node_modules/piscina/dist/worker.js:146:32
```

Closes angular#28212
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Aug 15, 2024
…n occurs during prerendering

This change enhances the error messaging when an unhandled exception occurs during the prerendering process. The updated error message provides more context and clarity.

**Previous Behavior**

```
ng b
An unhandled exception occurred: Some error!!!
See "/tmp/ng-S2ABKF/angular-errors.log" for further details.
```

**Updated Behavior:**
```
ng b
Browser bundles
Initial chunk files     | Names               |  Raw size | Estimated transfer size
main-AFPIPGGK.js        | main                | 218.00 kB |                59.48 kB
polyfills-Z2GOM3BN.js   | polyfills           |  35.82 kB |                11.80 kB
styles-5INURTSO.css     | styles              |   0 bytes |                 0 bytes

                        | Initial total       | 253.82 kB |                71.28 kB

Server bundles
Initial chunk files     | Names               |  Raw size
server.mjs              | server              |   1.11 MB |
chunk-HZL5H5M5.mjs      | -                   | 526.77 kB |
polyfills.server.mjs    | polyfills.server    | 269.91 kB |
chunk-GFWAPST7.mjs      | -                   |  19.16 kB |
chunk-5XUXGTUW.mjs      | -                   |   2.55 kB |
render-utils.server.mjs | render-utils.server |   1.46 kB |
main.server.mjs         | main.server         | 149 bytes |

Lazy chunk files        | Names               |  Raw size
chunk-7YC4RJ5P.mjs      | xhr2                |  12.08 kB |

Prerendered 1 static route.
Application bundle generation failed. [4.923 seconds]

✘ [ERROR] An error occurred while prerendering route '/'.

Error: Some error!!!
    at render (node_modules/@angular/build/src/utils/server-rendering/render-worker.js:20:20)
    at /angular-cli/abc/node_modules/piscina/dist/worker.js:146:32
```

Closes angular#28212
@alan-agius4 alan-agius4 unpinned this issue Aug 15, 2024
alan-agius4 added a commit that referenced this issue Aug 15, 2024
…n occurs during prerendering

This change enhances the error messaging when an unhandled exception occurs during the prerendering process. The updated error message provides more context and clarity.

**Previous Behavior**

```
ng b
An unhandled exception occurred: Some error!!!
See "/tmp/ng-S2ABKF/angular-errors.log" for further details.
```

**Updated Behavior:**
```
ng b
Browser bundles
Initial chunk files     | Names               |  Raw size | Estimated transfer size
main-AFPIPGGK.js        | main                | 218.00 kB |                59.48 kB
polyfills-Z2GOM3BN.js   | polyfills           |  35.82 kB |                11.80 kB
styles-5INURTSO.css     | styles              |   0 bytes |                 0 bytes

                        | Initial total       | 253.82 kB |                71.28 kB

Server bundles
Initial chunk files     | Names               |  Raw size
server.mjs              | server              |   1.11 MB |
chunk-HZL5H5M5.mjs      | -                   | 526.77 kB |
polyfills.server.mjs    | polyfills.server    | 269.91 kB |
chunk-GFWAPST7.mjs      | -                   |  19.16 kB |
chunk-5XUXGTUW.mjs      | -                   |   2.55 kB |
render-utils.server.mjs | render-utils.server |   1.46 kB |
main.server.mjs         | main.server         | 149 bytes |

Lazy chunk files        | Names               |  Raw size
chunk-7YC4RJ5P.mjs      | xhr2                |  12.08 kB |

Prerendered 1 static route.
Application bundle generation failed. [4.923 seconds]

✘ [ERROR] An error occurred while prerendering route '/'.

Error: Some error!!!
    at render (node_modules/@angular/build/src/utils/server-rendering/render-worker.js:20:20)
    at /angular-cli/abc/node_modules/piscina/dist/worker.js:146:32
```

Closes #28212

(cherry picked from commit 71c06c6)
@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 Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants