Skip to content

Commit 6293c06

Browse files
pirateclaude
andcommitted
Worker: escape \n in loading-page renderLog so JS is valid
Inside loadingPage()'s template literal, .join('\n') was being interpreted by the outer TS template — emitting a literal newline inside a JS string in the rendered HTML. That makes the JS a syntax error, so dispatch() never fires and the loading page sticks on "Triggering mining job…" with elapsed frozen at 00:00. Visitors never got mined because the trigger never happened. Fix: use '\\n' so the rendered JS contains '\n' (a real escape). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4393886 commit 6293c06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cloudflare/worker/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ function renderLog(lines) {
840840
: /^>>/.test(l) ? "l-hdr"
841841
: "";
842842
return '<span class="' + cls + '">' + esc(l) + '</span>';
843-
}).join("\n");
843+
}).join("\\n");
844844
$log.style.display = "block";
845845
$log.scrollTop = $log.scrollHeight;
846846
}

0 commit comments

Comments
 (0)