Commit 649e0bd
Wire RSC loader for both SWC and Babel transpilers
The previous implementation only handled Array.isArray(rule.use) and
only looked for babel-loader. The tutorial uses swc as its transpiler
(shakapacker.yml: javascript_transpiler: swc), which makes Shakapacker
generate rule.use as a FUNCTION, not an array. The RSC loader was
therefore never attached to the transpilation rule — 'use client'
files were left untransformed in the RSC bundle, producing 134
webpack warnings (export 'useState' not found in 'react' etc.) and
setting up a runtime error when the RSC renderer would try to call
client components directly instead of emitting client references.
Follow the pattern from docs/oss/migrating/rsc-preparing-app.md:167
verbatim, which handles both forms and both loader names.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bc716e0 commit 649e0bd
1 file changed
Lines changed: 21 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
21 | 34 | | |
22 | 35 | | |
23 | 36 | | |
| |||
0 commit comments