Skip to content

Commit b081e9d

Browse files
justin808claude
andcommitted
Add debug logging to verify console replay is unwrapped
Adding temporary debug code to help diagnose why CI tests are seeing wrapped console replay output when the code should be using the unwrapped version. This will log an error if consoleReplayScript starts with '<script', which would indicate it's incorrectly wrapped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5a63fad commit b081e9d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ export const transformRenderStreamChunksToResultObject = (renderState: StreamRen
114114
const htmlChunk = chunk.toString();
115115
// Get unwrapped console replay JavaScript (not wrapped in <script> tags)
116116
const consoleReplayScript = consoleReplay(previouslyReplayedConsoleMessages, consoleHistory);
117+
118+
// DEBUG: Log to verify we're using the unwrapped version
119+
if (consoleReplayScript && consoleReplayScript.startsWith('<script')) {
120+
console.error('ERROR: Console replay is wrapped when it should be unwrapped!');
121+
console.error('First 100 chars:', consoleReplayScript.substring(0, 100));
122+
}
123+
117124
previouslyReplayedConsoleMessages = consoleHistory?.length || 0;
118125
const jsonChunk = JSON.stringify(createResultObject(htmlChunk, consoleReplayScript, renderState));
119126
this.push(`${jsonChunk}\n`);

0 commit comments

Comments
 (0)