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: send function-request when static to show Static Notebook warning (#6765)

Myles Scolnick0a5c63a4e822
diff --git a/frontend/src/plugins/core/registerReactComponent.tsx b/frontend/src/plugins/core/registerReactComponent.tsx
index 6ac48800d2..4fc3874758 100644
--- a/frontend/src/plugins/core/registerReactComponent.tsx
+++ b/frontend/src/plugins/core/registerReactComponent.tsx
@@ -32,6 +32,7 @@ import { UIElementRegistry } from "@/core/dom/uiregistry";
import { FUNCTIONS_REGISTRY } from "@/core/functions/FunctionRegistry";
import { LocaleProvider } from "@/core/i18n/locale-provider";
import { store } from "@/core/state/jotai";
+import { isStaticNotebook } from "@/core/static/static-state";
import {
type HTMLElementNotDerivedFromRef,
useEventListener,
@@ -182,10 +183,13 @@ function PluginSlotInternal<T>(
const objectId = getUIElementObjectId(hostElement);
invariant(objectId, "Object ID should exist");
+ const isStatic = isStaticNotebook();
+
const htmlId = HTMLCellId.findElementThroughShadowDOMs(hostElement)?.id;
const cellId = htmlId ? HTMLCellId.parse(htmlId) : null;
- if (cellId) {
+ if (cellId && !isStatic) {
// If the cell is not initialized, throw an error
+ // Continue if the cell is static, so we can propagate a clearer error message.
const notebookState = store.get(notebookAtom);
const cellRuntime = notebookState.cellRuntime[cellId];
const cellData = notebookState.cellData[cellId];