Skip to content

Fix banner build#2983

Merged
ArthurSens merged 1 commit intomainfrom
fix-banner
May 6, 2026
Merged

Fix banner build#2983
ArthurSens merged 1 commit intomainfrom
fix-banner

Conversation

@ArthurSens
Copy link
Copy Markdown
Member

@ArthurSens ArthurSens commented May 6, 2026

Follow up to #2978

The logs made me think that the problem was while rendering old release pages from the Prometheus repository, but after further investigation, the problem was indeed on the banner!

The banner was already broken before the changes in #2978, but the change to the active date finally caused the build to render it, whereas it had not been rendered before.

I'm definitely not a front-end developer, so I rely a lot on LLM tools to make the fixes here. Please let me know if you have better ways to fix this!

Logs for the build failure on main can be seen here: https://app.netlify.com/projects/prometheus-docs/deploys/69fb29ec6ee9e60008fe05f2

Root cause analysis from the LLM:

`src/app/docs/layout.tsx` was a Server Component that rendered Mantine's
`Popover`, `PopoverTarget`, and `PopoverDropdown` directly for the mobile docs
navigation. `PopoverTarget` clones its child and reads `child.props.className`.
That is safe in a Client Component, but brittle when this interactive Mantine
popover is rendered through the Server Component tree during static export.

The announcement commit exposed the issue because it activated a client-rendered
header branch for the first time in this date window. The fetched repository docs
were only where Next happened to be prerendering when the shared docs layout
crashed; they were not the cause.

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
@ArthurSens ArthurSens requested review from jan--f and juliusv May 6, 2026 12:46
@sysadmind
Copy link
Copy Markdown
Contributor

sysadmind commented May 6, 2026

I have not had to deal with server vs client components in Mantine, but according to their docs, all components are already client components. https://help.mantine.dev/q/server-components#should-i-add-use-client-directive-to-all-files.

Actually turns out that sometimes use client is the right answer if you look further down at those errors on that link.

@ArthurSens
Copy link
Copy Markdown
Member Author

Ah gotcha, so the only fix here is that we're adding use client; at the top?

@sysadmind
Copy link
Copy Markdown
Contributor

I'm not sure @ArthurSens. Javascript has a lot of "magic" that I find hard to reason about. In this case, it's what decides if a component is a client component or a server component. I think these changes are probably fine.

Copy link
Copy Markdown
Contributor

@sysadmind sysadmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ArthurSens
Copy link
Copy Markdown
Member Author

Thank you for the help @sysadmind !

@ArthurSens ArthurSens merged commit abe6a2a into main May 6, 2026
6 checks passed
@ArthurSens ArthurSens deleted the fix-banner branch May 6, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants