Commit 226e461
Fix double-wrapping of console replay script in streaming renderer
The streaming renderer was calling `buildConsoleReplay()` which wraps
the console replay JavaScript in a `<script>` tag. However, the Ruby
helper then called `wrap_console_script_with_nonce()` again, creating
nested script tags:
```html
<script id="consoleReplayLog">
<script id="consoleReplayLog">
console.log...
</script>
</script>
```
This caused the test to fail because Nokogiri's `.text` on the outer
script returned the inner `<script id="consoleReplayLog">` as text.
**Solution:**
Changed streamingUtils.ts to use `consoleReplay()` instead of
`buildConsoleReplay()`. The `consoleReplay()` function returns just
the JavaScript code without wrapping, allowing the Ruby helper to
add the single script tag with proper CSP nonce support.
**Fixes:**
- Failing test: Console logging from server when replay_console=true
- Test file: react_on_rails_pro/spec/dummy/spec/requests/renderer_console_logging_spec.rb:52
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 6e61fc5 commit 226e461
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
0 commit comments