# Publish button disabled because of invalid MDX (/help-center/publish-button-disabled-invalid-mdx)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 405 · updated: 2026-09-23 -->

If you cannot click the **Publish** button in the editor and hovering over it shows the **Fix invalid MDX before publishing** error tooltip, at least one page on your branch has MDX that fails to parse. The editor blocks publishing until every page on the branch parses successfully. This keeps broken syntax from reaching your live site.

The tooltip tells you how many pages have errors. The same error blocks **Request review** on feature branches. Common causes include:

* An unclosed component tag, such as a `<Note>` without a matching `</Note>`.
* Malformed JSX in the page body, such as an unclosed brace in an expression.
* Frontmatter that isn't valid YAML, such as inconsistent indentation or an unclosed quote.

While a page has invalid MDX or invalid frontmatter YAML, those edits stay local to you. Teammates editing the same page only receive valid content, so a syntax error you introduce doesn't overwrite their work. See [Collaborate in the editor](/editor/collaborate) for how real-time editing handles invalid content.

## Fix the error manually [#fix-the-error-manually]

1. Open the affected page in the editor.
2. Switch to source mode with <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>S</kbd> (macOS) or <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>S</kbd> (Windows). Source mode highlights the invalid MDX and shows the parsing error.
3. Fix the syntax. Once the page parses, the error clears and the **Publish** button becomes available again.

## Fix the error with the agent [#fix-the-error-with-the-agent]

1. Open the editor panel.
2. Prompt the agent to fix any invalid MDX or frontmatter YAML.
