Caching fails with "The scope does not contain a valid 'app' instance. marimo behavior may be undefined."
Describe the bug
Try executing any cell using mo.cache, and you'll see The scope does not contain a valid 'app' instance. marimo behavior may be undefined. messages. The caching also fails.
Environment
text
marimo VS Code Extension Diagnostics
=====================================
Language Server (LSP):
UV Bin: Bundled (/home/aidan/.vscode/extensions/marimo-team.vscode-marimo-0.10.5-linux-x64/bundled/libs/bin/uv)
UV: 0.9.26 ✓
Using bundled marimo-lsp via uvx
Python Extension:
Interpreter: /home/aidan/af/daylon/.venv/bin/python
Version: 3.13.3.final.0
Python Language Server (ty):
Status: running ✓
Version: 0.0.17
Python: /home/aidan/af/daylon/.venv/bin/python (3.13.3.final.0)
Ruff Language Server:
Status: running ✓
Version: 0.15.1
Extension Configuration:
Version: 0.10.5
UV integration disabled: false
System Information:
Host: desktop
IDE: Visual Studio Code
IDE version: 1.109.4
Platform: linux
Architecture: x64
Node version: v22.21.1
Common Issues:
1. If notebooks won't open:
- Check Python interpreter is selected
- Ensure marimo and pyzmq are installed
- Check 'marimo-lsp' output channel for errors
2. If features are missing:
- Ensure marimo version is >= 0.19.10
- Try reloading the window
Steps to reproduce
Execute this as a cell
python
import marimo as mo
@mo.cache
def slow():
import time
time.sleep(1)
return "Done sleeping!"
slow()