Skip to content

Fix: Replace invalid 'wide' app_width value with 'medium'#50

Merged
mscolnick merged 2 commits intomainfrom
copilot/fix-embed-marimo-notebooks
Oct 21, 2025
Merged

Fix: Replace invalid 'wide' app_width value with 'medium'#50
mscolnick merged 2 commits intomainfrom
copilot/fix-embed-marimo-notebooks

Conversation

Copy link
Contributor

Copilot AI commented Oct 21, 2025

Problem

Embedding marimo notebooks was failing with a validation error:

msgspec.ValidationError: Invalid enum value 'wide' - at `$.app_config.width`

This error prevented marimo playground embeds from loading, breaking the documentation examples at https://marimo-team.github.io/mkdocs-marimo/getting-started/blocks/

Error Screenshot

Root Cause

The marimo library updated its validation system and no longer accepts 'wide' as a valid enum value for app_width. The plugin was using 'wide' as the default value, causing all embedded notebooks to fail validation.

Solution

Replaced all occurrences of 'wide' with 'medium' throughout the codebase:

Code changes:

  • Updated default app_width value from "wide" to "medium" in MarimoEmbedBlock.OPTIONS
  • Updated validation enum to accept ["medium", "full", "compact"] instead of ["wide", "full", "compact"]
  • Updated function parameter default in create_marimo_app_code()

Documentation updates:

  • Updated all example code blocks in docs/getting-started/blocks.md and docs/getting-started/quick-start.md
  • Updated configuration tables to reflect the correct valid values
  • Updated README.md to show the correct options

Impact

After this change, users can successfully embed marimo notebooks without encountering validation errors. The valid values for app_width are now:

  • medium (default, previously wide)
  • full
  • compact

Fixes the issue reported in the original bug report where embedded notebooks were showing "Something went wrong" errors.

Original prompt

This section details on the original issue you should resolve

<issue_title>Error embedding marimo Notebooks with the Playground - Invalid enum value 'wide'</issue_title>
<issue_description>This code which should render an embedded marimo notebook in the mkdocs documentation site raises an error (See Attached screenshot)

Note that this error is also present in the marimo-mkdocs documentation website: https://marimo-team.github.io/mkdocs-marimo/getting-started/blocks/

But not in the marimo.io documentation: https://docs.marimo.io/api/layouts/accordion/

/// marimo-embed
    height: 400px
    mode: read

```python
@app.cell
def __():
    import marimo as mo

    name = mo.ui.text(placeholder="Enter your name", debounce=False)
    name
    return

@app.cell
def __():
    mo.md(f"Hello, **{name.value or '__'}**!")
    return
```
///

Results in the following error:

Image

Full error logs:

Traceback (most recent call last): File "/lib/python312.zip/_pyodide/_base.py", line 523, in eval_code .run(globals, locals) ^^^^^^^^^^^^^^^^^^^^ File "/lib/python312.zip/_pyodide/_base.py", line 357, in run coroutine = eval(self.code, globals, locals) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<exec>", line 10, in <module> File "/lib/python3.12/site-packages/marimo/_pyodide/bootstrap.py", line 111, in create_session write_kernel_message( File "/lib/python3.12/site-packages/marimo/_pyodide/bootstrap.py", line 86, in write_kernel_message op_name = deserialize_kernel_message(op).name ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/lib/python3.12/site-packages/marimo/_messaging/ops.py", line 75, in deserialize_kernel_message return msgspec.json.decode(message, strict=True, type=MessageOperation) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ msgspec.ValidationError: Invalid enum value 'wide' - at `$.app_config.width`
```</issue_description>

<agent_instructions>`"wide"` needs to be replaced with `"medium"` in the codebase</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
<comment_new><author>@mscolnick</author><body>
@Josersanvil yea you can roll this yourself by copying what we did with https://github.com/marimo-team/marimo/blob/665a683bfa40c9133d1a2698926af615418e332e/docs/blocks.py#L172

this comes with a bit more flexibility. 

as far as the error you are seeing, this was a change in our deserialization which includes validation. it looks like we were incorrectly using the wrong value for that field in this repo. you could 
1. downgrade marimo to an earlier version (`~0.15.0` might work)
2. or pass an explicit `app_width` of `"full"` or `"compact"` in the args</body></comment_new>
</comments>

Fixes #49


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: mscolnick <2753772+mscolnick@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error embedding marimo notebooks in mkdocs documentation Fix: Replace invalid 'wide' app_width value with 'medium' Oct 21, 2025
Copilot AI requested a review from mscolnick October 21, 2025 16:44
@mscolnick mscolnick marked this pull request as ready for review October 21, 2025 16:48
@mscolnick mscolnick merged commit 0a8fdd6 into main Oct 21, 2025
8 of 30 checks passed
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.

Error embedding marimo Notebooks with the Playground - Invalid enum value 'wide'

2 participants