CMS editor: opening an .mdx file gets an error
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- nextjs, typescript
Research direction
Inspect components/cms/FileEditor.tsx around lines 335-359, where the open-file tabs are rendered, and reproduce the issue by opening an .mdx file in the CMS at app/admin/(dashboard)/cms/page.tsx. The fix is complete when the file tab controls no longer produce a nested-button hydration error in the console.
Written by the indexing model from the issue text.
Description
## Error Type
Console Error
## Error Message
In HTML, <button> cannot be a descendant of <button>.
This will cause a hydration error.
...
<RedirectBoundary>
<RedirectErrorBoundary router={{...}}>
<InnerLayoutRouter url="/admin/cms" tree={[...]} params={{}} cacheNode={{rsc:<Fragment>, ...}} ...>
<SegmentViewNode type="page" pagePath="/toolkata/...">
<SegmentTrieNode>
<ClientPageRoot Component={function CMSPage} serverProvidedParams={{...}}>
<CMSPage params={Promise} searchParams={Promise}>
<div className="flex flex-...">
<div>
<div className="flex-1 fle...">
<div>
<div className="flex-1 fle...">
<FileEditor files={[...]} activeFileIndex={0} ...>
<div className="flex flex-...">
<div className="flex items..." role="tablist" aria-label="Open files">
> <button
> type="button"
> role="tab"
> aria-selected={true}
> aria-controls="editor-panel-0"
> onClick={function onClick}
> onMouseDown={function onMouseDown}
> className="group flex items-center gap-1.5 px-3 py-1.5 text-xs font-mono rounded-t trans..."
> >
<span>
<span>
> <button
> type="button"
> onClick={function onClick}
> className="ml-1 p-0.5 rounded text-[var(--color-text-dim)] hover:text-[var(--color-err..."
> aria-label="Close glossary.ts"
> >
...
...
...
...
...
at button (<anonymous>:null:null)
at <unknown> (components/cms/FileEditor.tsx:359:13)
at Array.map (<anonymous>:null:null)
at FileEditor (components/cms/FileEditor.tsx:335:16)
at CMSPage (app/admin/(dashboard)/cms/page.tsx:740:13)
## Code Frame
357 | />
358 | )}
> 359 | <button
| ^
360 | type="button"
361 | onClick={(e) => {
362 | e.stopPropagation()
Next.js version: 16.1.4 (Turbopack)
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hmemcpy/toolkata
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in hmemcpy/toolkata
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100