Closed c-marchese closed 1 month ago
@c-marchese Thank you for submitting an issue!
We can confirm that this is indeed an issue. We will be taking a look!
@c-marchese
I fixed a slightly different issue / gave a different solution to your issue at https://github.com/vercel/next.js/pull/71914:
If you import a style file to the root layout, that style stopped being applied to global-error after >= 14.2.8. This may not be a bug, because it's reasonable to assume that if the root layout throws, the root layout styles don't get applied. So I think the current behaviour is good there.
However, my fix is that you'd need to import the styles to global-error (separately from root layout) for the global error styling to work. And, this is a net new feature.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/c-marchese/next-global-styles-in-global-error
To Reproduce
Current vs. Expected behavior
Following the steps from the previous section, I expected to see a red background but I observed a white background. This means global.css has not been applied to the global-error.tsx page.
Provide environment information
Which area(s) are affected? (Select all that apply)
Module Resolution
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
Until Next 14.2.7, global-error.tsx shows a red background (see https://github.com/c-marchese/next-global-styles-in-global-error/tree/next14.2.7). Starting Next 14.2.8 – and in the latest canary – it doesn't.
I believe https://github.com/vercel/next.js/pull/69507 might be related to this issue.