diff --git a/shared/sx/helpers.py b/shared/sx/helpers.py index 374b840..1fdccb9 100644 --- a/shared/sx/helpers.py +++ b/shared/sx/helpers.py @@ -811,6 +811,12 @@ async def sx_page(ctx: dict, page_sx: str, *, if pages_sx: _plog.debug("sx_page: pages_sx first 200 chars: %s", pages_sx[:200]) + # Ensure page_sx is a plain str, not SxExpr — _build_component_ast + # parses SxExpr back into AST, which _arender then evaluates as HTML + # instead of passing through as raw content for the script tag. + if isinstance(page_sx, SxExpr): + page_sx = "".join([page_sx]) + return await render_to_html( "sx-page-shell", title=_html_escape(title),