Fix production blank page: SxExpr page_sx was being parsed as AST
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 7m33s

_build_component_ast parsed SxExpr values back into AST, which
_arender then evaluated as HTML instead of passing through as raw
content for the script tag. Dev mode was unaffected because the
pretty-printer converted page_sx to a plain str first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 00:17:01 +00:00
parent ff41fa2238
commit c0ced8a40f

View File

@@ -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),