You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support opt-in cell error display in static HTML exported with --no-include-code #11065
When a notebook with a failing cell is exported with marimo export html --no-include-code, the failed cell and any cell that fails because of it are not rendered in the browser at all. Successful outputs before and after them render normally, so a distributed report can look complete even though part of it failed.
The CLI reports the failure correctly (exit status 1, see below), which helps whoever runs the export, but readers of the HTML cannot see it.
The static HTML documentation notes that a generated export may contain the error. In this reproduction, the error is present in the embedded session snapshot, but it is not visible in the browser when --no-include-code is
used:
The dependent cell's ancestor error is serialized the same way. The serialized evalue is the original exception message, so the information needed for a short, code-free error display is already in the file.
I understand that --no-include-code intentionally clears source code and console output (including tracebacks), and I am not asking to change that default.
marimo export html repro.py -o repro.debug.html
marimo export html --no-include-code repro.py -o repro.html
Both export commands produced the following CLI output and exited with
status code 1:
MarimoExceptionRaisedError: intentional export error
MarimoExceptionRaisedError: An ancestor raised an exception (ValueError):
Error: Export was successful, but some cells failed to execute.
repro.debug.html renders 'before error', the failing cell (message +
traceback), the dependent cell (ancestor error), and 'after error'.
repro.html renders only 'before error' and 'after error'. There is
no error box, placeholder, or warning.
Screenshots:
repro.jpeg:
repro.debug.jpeg:
Suggested solution
The primary request is persistent failure visibility, not traceback disclosure.
Please add an opt-in for HTML export that keeps failures visible while source code remains hidden. Any of the following would satisfy this use case:
render the serialized evalue at the failed cell's position, e.g.
This cell failed to execute.
intentional export error
render a generic placeholder, e.g. for dependent cells
This output is unavailable because an upstream cell failed.
show a persistent document-level warning, e.g.
This report contains one or more cell execution errors.
A full traceback is not required; exporting with code already covers diagnostics.
The exact interface is up to the maintainers. One possible CLI design would be:
marimo export html --no-include-code --show-errors repro.py -o repro.html
marimo run already provides --show-tracebacks and runtime.show_tracebacks as opt-in mechanisms for displaying detailed exception information that is hidden by default in run mode. Reusing or extending that configuration may give a consistent user experience, but a separate, sanitized export setting may also be more appropriate.
Environment
OS: Windows 11
Python: 3.13
Browser: Microsoft Edge 154.0.4258.37
marimo: 0.25.0
Are you willing to submit a PR? (You must receive approval from the team before submitting a PR.)
Yes
Alternatives
Export with code included. This shows errors but exposes source code.
Check the exit status in CI and avoid publishing the HTML on failure.
This is what I do now, but it does not help when a report with failures is intentionally shared, or when the HTML is distributed separately from the CI log.
In marimo run, the same notebook initially shows a transient "An internal error occurred" toast. marimo run already provides --show-tracebacks for opting into detailed error information. No change to marimo run is requested by this issue.
Reproduced with the repro.py above on marimo 0.25.0, and with an equivalent .py notebook on 0.24.2. First noticed with a .qmd notebook on 0.24.0, so it is not specific to Quarto/QMD.
Description
When a notebook with a failing cell is exported with
marimo export html --no-include-code, the failed cell and any cell that fails because of it are not rendered in the browser at all. Successful outputs before and after them render normally, so a distributed report can look complete even though part of it failed.The CLI reports the failure correctly (exit status
1, see below), which helps whoever runs the export, but readers of the HTML cannot see it.The static HTML documentation notes that a generated export may contain the error. In this reproduction, the error is present in the embedded session snapshot, but it is not visible in the browser when
--no-include-codeisused:
{"ename": "exception", "evalue": "intentional export error", "traceback": null, "type": "error"}The dependent cell's ancestor error is serialized the same way. The serialized
evalueis the original exception message, so the information needed for a short, code-free error display is already in the file.I understand that
--no-include-codeintentionally clears source code and console output (including tracebacks), and I am not asking to change that default.Reproduction
repro.py:Both export commands produced the following CLI output and exited with
status code
1:repro.debug.htmlrenders'before error', the failing cell (message +traceback), the dependent cell (ancestor error), and
'after error'.repro.htmlrenders only'before error'and'after error'. There isno error box, placeholder, or warning.
Screenshots:
Suggested solution
The primary request is persistent failure visibility, not traceback disclosure.
Please add an opt-in for HTML export that keeps failures visible while source code remains hidden. Any of the following would satisfy this use case:
evalueat the failed cell's position, e.g.A full traceback is not required; exporting with code already covers diagnostics.
The exact interface is up to the maintainers. One possible CLI design would be:
marimo export html --no-include-code --show-errors repro.py -o repro.htmlmarimo runalready provides--show-tracebacksandruntime.show_tracebacksas opt-in mechanisms for displaying detailed exception information that is hidden by default in run mode. Reusing or extending that configuration may give a consistent user experience, but a separate, sanitized export setting may also be more appropriate.Environment
Are you willing to submit a PR? (You must receive approval from the team before submitting a PR.)
Alternatives
This is what I do now, but it does not help when a report with failures is intentionally shared, or when the HTML is distributed separately from the CI log.
Additional context
marimo export html#3089 added the non-zero exit status and CLI error output for failed exports. That works as expected here.marimo run, the same notebook initially shows a transient "An internal error occurred" toast.marimo runalready provides--show-tracebacksfor opting into detailed error information. No change tomarimo runis requested by this issue.repro.pyabove on marimo 0.25.0, and with an equivalent.pynotebook on 0.24.2. First noticed with a.qmdnotebook on 0.24.0, so it is not specific to Quarto/QMD.