Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: traceback overflow (#1852)

Myles Scolnick3f0f00ce4b96
diff --git a/frontend/src/components/editor/output/MarimoTracebackOutput.tsx b/frontend/src/components/editor/output/MarimoTracebackOutput.tsx
index 312843d8be..b4f074362e 100644
--- a/frontend/src/components/editor/output/MarimoTracebackOutput.tsx
+++ b/frontend/src/components/editor/output/MarimoTracebackOutput.tsx
@@ -10,7 +10,6 @@ import {
import { Button, buttonVariants } from "@/components/ui/button";
import { renderHTML } from "@/plugins/core/RenderHTML";
-import "./traceback-output.css";
import { BugIcon, ChevronDown, ExternalLinkIcon } from "lucide-react";
import { useState } from "react";
import { useAtomValue } from "jotai";
@@ -42,8 +41,10 @@ export const MarimoTracebackOutput = ({
});
};
+ const [error, errorMessage] = lastTracebackLine.split(":", 2);
+
return (
- <div className="flex flex-col gap-2">
+ <div className="flex flex-col gap-2 min-w-full w-fit">
<Accordion type="single" collapsible={true} value={expanded ? KEY : ""}>
<AccordionItem value={KEY} className="border-none">
<div
@@ -56,13 +57,12 @@ export const MarimoTracebackOutput = ({
expanded ? "rotate-180" : "rotate-0",
)}
/>
- <div className="pb-5">
- <div className="traceback-header text-destructive line-clamp-1 text-sm inline">
- {htmlTraceback}
- </div>
+ <div className="text-sm inline font-mono">
+ <span className="text-destructive">{error || "Error"}:</span>{" "}
+ {errorMessage}
</div>
</div>
- <AccordionContent className="px-4 text-muted-foreground px-4 pt-2 text-xs">
+ <AccordionContent className="px-4 text-muted-foreground px-4 pt-2 text-xs overflow-auto">
{htmlTraceback}
</AccordionContent>
</AccordionItem>
diff --git a/frontend/src/components/editor/output/traceback-output.css b/frontend/src/components/editor/output/traceback-output.css
deleted file mode 100644
index 2e63142899..0000000000
--- a/frontend/src/components/editor/output/traceback-output.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.traceback-header {
- display: inline-grid;
- height: 1lh; /* height of one line */
- overflow: hidden;
- place-content: end;
-}
-
-/* fallback if lh is not supported */
-@supports not (height:1lh) {
- .traceback-header {
- line-height: 1.5em;
- height: 1.5em;
- }
-}
diff --git a/marimo/_smoke_tests/bugs/1851.py b/marimo/_smoke_tests/bugs/1851.py
new file mode 100644
index 0000000000..78b4e361aa
--- /dev/null
+++ b/marimo/_smoke_tests/bugs/1851.py
@@ -0,0 +1,14 @@
+import marimo
+
+__generated_with = "0.7.9"
+app = marimo.App(width="medium")
+
+
+def __():
+ raise ValueError("".join([str(i) for i in range(1000)]))
+ return
+
+
+if __name__ == "__main__":
+ app.run()