Add console logging for client-side routing decisions
tryClientRoute now logs why it falls through: has-data, no content, eval failed, or #main-panel not found. tryEvalContent logs the actual error on catch. Added logWarn platform function (console.warn). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -497,6 +497,7 @@ class JSEmitter:
|
||||
"store-env-attr": "storeEnvAttr",
|
||||
"to-kebab": "toKebab",
|
||||
"log-info": "logInfo",
|
||||
"log-warn": "logWarn",
|
||||
"log-parse-error": "logParseError",
|
||||
"parse-and-load-style-dict": "parseAndLoadStyleDict",
|
||||
"_page-routes": "_pageRoutes",
|
||||
@@ -2625,6 +2626,7 @@ PLATFORM_ORCHESTRATION_JS = """
|
||||
}
|
||||
return sxRenderWithEnv(source, merged);
|
||||
} catch (e) {
|
||||
console.warn("sx:route eval error", e);
|
||||
return NIL;
|
||||
}
|
||||
}
|
||||
@@ -2974,6 +2976,10 @@ PLATFORM_BOOT_JS = """
|
||||
if (typeof console !== "undefined") console.log("[sx-ref] " + msg);
|
||||
}
|
||||
|
||||
function logWarn(msg) {
|
||||
if (typeof console !== "undefined") console.warn("[sx-ref] " + msg);
|
||||
}
|
||||
|
||||
function logParseError(label, text, err) {
|
||||
if (typeof console === "undefined") return;
|
||||
var msg = err && err.message ? err.message : String(err);
|
||||
|
||||
Reference in New Issue
Block a user