Skip to content

Commit 9e0ca51

Browse files
committed
widgets: fix ts issue hit when building nextjs app
1 parent e86e514 commit 9e0ca51

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/packages/frontend/jupyter/output-messages/ipywidget.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,17 @@ export function IpyWidget({ value, actions }: WidgetProps) {
6666
// HACK: because upstream ipywidgets only checks for MathJax.Hub to be defined then
6767
// crashes on load -- they don't see this bug because user has to explicitly re-evaluate
6868
// code to see anything on page refresh, due to all state being on the frontend.
69+
// @ts-ignore
6970
if (window.MathJax != null && window.MathJax.Hub == null) {
71+
// @ts-ignore
7072
MathJax.Hub.Queue = () => {};
7173
}
7274
setTimeout(() => {
7375
// Run mathjax on labels: widgets.HBox([widgets.Label(value="The $m$ in $E=mc^2$:"), widgets.FloatSlider()])
7476
// @ts-ignore
75-
$(divRef.current).find(".widget-label").katex({ preProcess: true });
77+
$(divRef.current).find(".widget-label").katex?.({ preProcess: true });
7678
// @ts-ignore
77-
$(divRef.current).find(".widget-htmlmath").katex({ preProcess: true });
79+
$(divRef.current).find(".widget-htmlmath").katex?.({ preProcess: true });
7880
}, 0);
7981
} catch (err) {
8082
console.warn(err);

0 commit comments

Comments
 (0)