-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Enabling prerender causing serializedViews is not iterable #56039
Comments
I'd be helpful if you could share a runnable reproduction. |
I tried to reproduce it but couldn't figure it out :(. I can share a live url where error occurs if you'd like to see it live. |
We'd likely need source code to determine what template is causing issues here. You may be able to remove parts of the app iteratively until the error no longer occurs, narrowing down which template is causing this. |
Thanks @JoostK , I removed contents of templates until i reached the main template: app.component.html.
I'll try to check if this is not triggered by a mismatch in angular dependencies versions (typescript and rxjs) for the time being. |
Okay, now i think i understand what's happening. I started doing what you said about creating a new project with a reproduceable error, so i stripped everything around my article content and that's when i understood a part of my problem (at least for now):
I imagine that the server tries to find the static file, and if it's not there, it doesn't try to solve it dynamically and just throws a 404 ? Once the browser runs the code, it gets resolved dynamically because data is available in the backend. Does that mean that by default prerender: true does not act in a hybrid way ? it's either there is a static file and if not, it just sends a 404 ? |
cc @alan-agius4 to see if this "page not found" behavior is known. @hhsissi it'd still be helpful to have a repro where you see the original error (the "serializedViews is not iterable" one), so that we can improve the developer experience (e.g. provide a better error message and/or detect the problem earlier). |
@AndrewKushnir, no idea what is causing that 404. This might be related to your server configuration. |
Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information. If the problem still exists in your application, please open a new issue and follow the instructions in the issue template. |
Which @angular/* package(s) are the source of the bug?
platform-server, Don't known / other
Is this a regression?
Yes
Description
The error mentionned happens on various pages:
1- pages behind a guard after a refresh
2- random urls having the same component and route pattern: news/:newsSlug
setting:
fixes the problem.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
Appeared after I migrated to Angular 17 + ClientHydration + prerender enabled.
The following error happens only on
In production build on pages behind guards after a refresh (F5)
Frequency: Systematic.
Randomness: no
Details: redirecting to login does not work anymore.
In production build on pages of the same route: news/:slug (no guard).
Frequency: Systematic.
Randomness: yes
Result: No noticeable regression on page interactions.
Details: Concerning the case **In production build on pages of the same route: news/:slug **, i tried to debug it a little bit, as i thought it might be related to data for example. I emptied the template, the component itself leaving only an empty constructor + no imports other than the necessary @Injectable and stuff like that. Result stayed the same. Error appears on article A consistantly, but not article B (consistantly too).
The main error message is:
In order to get a clearer message, i had to run
Any precisions on when this error usualy occurs would be very welcome. Thank you
The text was updated successfully, but these errors were encountered: