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

Prerended custom 500 page does not include imported stylesheets #8005

Closed
1 task
minht11 opened this issue Aug 8, 2023 · 5 comments · Fixed by #8070
Closed
1 task

Prerended custom 500 page does not include imported stylesheets #8005

minht11 opened this issue Aug 8, 2023 · 5 comments · Fixed by #8070
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@minht11
Copy link
Contributor

minht11 commented Aug 8, 2023

What version of astro are you using?

2.10.3

Are you using an SSR adapter? If so, which one?

Node

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Chrome, Firefox, Safari

Describe the Bug

Prerended custom 500 page does not include imported stylesheets in production mode. Changing prerender to false, fixes it.

What's the expected result?

Stylesheets are imported correctly inside custom 500 page.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-pt4enm-cr35nf

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Aug 8, 2023
@natemoo-re
Copy link
Member

Hmm, this is surprising because it should be passing through the 500 page directly. Will take a look at this!

@natemoo-re natemoo-re added the - P3: minor bug An edge case that only affects very specific usage (priority) label Aug 9, 2023
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Aug 9, 2023
@lilnasy lilnasy self-assigned this Aug 10, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Aug 10, 2023

@natemoo-re
Copy link
Member

Seems to have been introduced with #7946. (edit: confirmed)

Last good version 2.10.1.

Ah interesting... not sure how to square this, in that case. My guess is that we aren't ignoring the prerender value in the RouteData, so the 500 route is actually being rendered on the server? That's the only way this bug makes sense.

@lilnasy
Copy link
Contributor

lilnasy commented Aug 10, 2023

Spot on!

500.astro is prerendered with the appropriate styles in <head> but the matched 500 route gets generated just-in-time

And because it's supposed to be prerendered, styles and scripts are empty arrays in the manifest.

@lilnasy
Copy link
Contributor

lilnasy commented Aug 10, 2023

Seems to have been introduced with #7946. (edit: confirmed)

Last good version 2.10.1.

Correction: this issue was not introduced by that PR. It only made it so that 500 fallback routes do not inherit styles/scripts from the original route that failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
3 participants