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: version init (#5324)

Myles Scolnick036fd3ff89ef
diff --git a/frontend/src/core/meta/state.ts b/frontend/src/core/meta/state.ts
index 632f9b081f..243916853c 100644
--- a/frontend/src/core/meta/state.ts
+++ b/frontend/src/core/meta/state.ts
@@ -1,7 +1,22 @@
/* Copyright 2024 Marimo. All rights reserved. */
+
import { atom } from "jotai";
+import { Logger } from "@/utils/Logger";
+
+function getVersionFromMountConfig(): string | null {
+ try {
+ const mountConfig = window.__MARIMO_MOUNT_CONFIG__ as { version: string };
+ return mountConfig.version;
+ } catch {
+ Logger.warn("Failed to get version from mount config");
+ return null;
+ }
+}
-const BUILD_VERSION: string = import.meta.env.VITE_MARIMO_VERSION || "unknown";
+const BUILD_VERSION: string =
+ getVersionFromMountConfig() ||
+ import.meta.env.VITE_MARIMO_VERSION ||
+ "unknown";
export const marimoVersionAtom = atom<string>(BUILD_VERSION);