Commit 5504d5a
Fix double-wrapped script tags in console replay
The issue was that serverRenderReactComponent was calling buildConsoleReplay()
which wraps the console code in script tags, but Ruby was ALSO wrapping it
with wrap_console_script_with_nonce(), resulting in nested script tags like:
<script id="consoleReplayLog"><script>...</script></script>
Changed serverRenderReactComponent to call consoleReplay() instead, which
returns just the JavaScript code without script tags. Ruby then wraps it
once with the proper nonce attribute.
This fixes the failing tests:
- ReactOnRailsProHelper html_streaming_react_component creates a fiber
- Console logging from server has server log messages in the script
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 52eefa4 commit 5504d5a
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
0 commit comments