Skip to content

Commit

Permalink
fix: support esm define when running under virtual kernel
Browse files Browse the repository at this point in the history
When we define a esm top level in a module, we don't need to create
the module widget. However, if we do this during the running of the
app under the context of a virtual kernel, we should directly
create the esm widget.

Should fix the failing of widgetti/ipyantd#4
  • Loading branch information
maartenbreddels committed Jun 5, 2024
1 parent 9b48fcf commit 02b9bf0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions solara/server/esm.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def define_module(name, module: Union[str, Path]):
if name in _modules:
old_module, dependencies = _modules[name]
_modules[name] = (module, dependencies)
if kernel_context.has_current_context():
create_modules()
return None


Expand Down

0 comments on commit 02b9bf0

Please sign in to comment.