Commit 1022234
Fix SSR runtime failures: Node renderer, polyfills, and RSC classification
Three root causes for the 37/38 rspec test failures:
1. CI missing Node renderer: The RSC branch switched SSR from ExecJS to
the react-on-rails-pro NodeRenderer service (port 3800). CI never
started this service, causing Net::ReadTimeout on all SSR requests.
Added renderer startup step and RENDERER_PASSWORD env var to CI.
2. Server bundle externals broke in VM sandbox: The previous commit
externalized Node builtins (path/fs/stream) as CommonJS requires,
but the Node renderer runs bundles in a vm.createContext() sandbox
where require() is unavailable. Reverted to resolve.fallback: false
which stubs these unused code paths at build time instead.
3. MessageChannel undefined in VM: react-dom/server.browser.js
instantiates MessageChannel at module load time. The Node renderer's
VM sandbox lacks this browser global (unlike Bun/ExecJS on master).
Added a BannerPlugin polyfill injected at bundle top.
4. RouterApp.server.jsx misclassified as RSC: The auto-bundling system
registered it via registerServerComponent() because it lacked 'use
client'. But it's a traditional SSR component (StaticRouter), not an
RSC. Added 'use client' directive so it registers via
ReactOnRails.register() instead.
All 38 rspec tests now pass locally.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3f7e452 commit 1022234
3 files changed
Lines changed: 47 additions & 17 deletions
File tree
- .github/workflows
- client/app/bundles/comments/startup/RouterApp/ror_components
- config/webpack
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
167 | 168 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
172 | 175 | | |
173 | 176 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
185 | 198 | | |
186 | 199 | | |
187 | 200 | | |
| |||
0 commit comments