-
Notifications
You must be signed in to change notification settings - Fork 12k
Please make timeout configurable in render-worker.ts #29005
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
Comments
@e-oz, I am curious to why each route is taking more than 30s to render. We could potentially increase the timeout, however in general 30s should be more than enough to rendering a single route. |
@alan-agius4 it takes a couple of seconds to render 20 routes. |
The initialization phase is not included in this process. The 30-second limit applies per route and begins as soon as the route rendering starts. It ends as soon as the route finishes rendering, not when it is added to the queue. If a timeout occurs, it indicates that one or more routes are taking 30 seconds or longer to render. |
All the pages enlisted in routes.txt send just 2 requests to the server, one takes ~150ms, and another takes ~250ms. There are no heavy requests. Sometimes pre-rendering fails even with 7 routes to pre-render. The app is zoneless - can it create a situation when renderer can not detect that the page’s rendering is complete? |
When using zoneless and server rendering, there are certainly some rough edges. However, I would expect the application to stabilize before time rather than the other way. Could you provide a reproduction of the issue? Does this behavior persist if the application is configured to use zones instead? |
That’s not a bug report, just a feature request :) |
SSG is generally stable. I believe a 30-second rendering timeout is typically sufficient. This has been the standard for several major versions, and this is the first time it's been brought to our attention that it's not enough. If a page doesn't stabilize within 30 seconds, it's usually an indication of a problem within the app itself. In the past, we've seen timeouts with zone.js, often due to the use of timeouts, intervals, or similar mechanisms, which caused delays in stabilizing the page. Closing for now, please feel free to open a new issue with a reproduction if you manage to find out the root cause. Thanks. |
@alan-agius4 in my case the app is very simple without any complex setTimout or complex computation. the issue is happening because the backend/api is taking time to return the response. I also thing 30s per route is fair enough, but it would be helpful if we have option to explicitly control this delay. |
I agree with @alan-agius4 and think that we should try to fix stabilization, not increase the timeout. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Command
build
Description
During pre-rendering, if we need to prerender multiple routes (like 36 routes), pre-rendering fails by timeout.
If I manually modify the timeout in this file, it works fine.
Yes, it takes time, but it is important to pre-render them all for us.
Describe the solution you'd like
Please add an option to
angular.json
configuration (or some flag, although an option would be much better - fewer dances with builders).Describe alternatives you've considered
The only alternative right now is to limit the amount of pre-rendered routes.
The text was updated successfully, but these errors were encountered: