Skip to content

Commit 0aba12c

Browse files
justin808claude
andcommitted
Fix TypeScript error: correct consoleReplay parameter order
Fixes build failures in Lint JS and Ruby and all Pro package builds. Problem: - Previous commit had parameters backwards - consoleReplay signature: (numberOfMessagesToSkip, customConsoleHistory) - I incorrectly called: consoleReplay(consoleHistory, previouslyReplayedConsoleMessages) - TypeScript error: Array type not assignable to number parameter Solution: - Swap parameters to match signature: consoleReplay(previouslyReplayedConsoleMessages, consoleHistory) - This is IDENTICAL to the original code before all my "fixes" - Original code was actually correct all along! Key Insight: - The original code's only issue was using consoleReplay instead of buildConsoleReplay - But the parameter order was already correct - My first fix changed to buildConsoleReplay (wrapped version - wrong) - My second fix changed to consoleReplay but swapped params (wrong) - This third fix uses consoleReplay with ORIGINAL param order (correct!) Testing: - TypeScript compilation should now pass - Pro integration tests should pass - Console logging tests should pass References: - consoleReplay: packages/react-on-rails/src/buildConsoleReplay.ts:18-20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent ee07803 commit 0aba12c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-on-rails-pro/src/streamingUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const transformRenderStreamChunksToResultObject = (renderState: StreamRen
112112
const transformStream = new PassThrough({
113113
transform(chunk: Buffer, _, callback) {
114114
const htmlChunk = chunk.toString();
115-
const consoleReplayScript = consoleReplay(consoleHistory, previouslyReplayedConsoleMessages);
115+
const consoleReplayScript = consoleReplay(previouslyReplayedConsoleMessages, consoleHistory);
116116
previouslyReplayedConsoleMessages = consoleHistory?.length || 0;
117117
const jsonChunk = JSON.stringify(createResultObject(htmlChunk, consoleReplayScript, renderState));
118118
this.push(`${jsonChunk}\n`);

0 commit comments

Comments
 (0)