Commit 0d253df
Fix webpack SCSS rule handling for Shakapacker 9.1.0
Shakapacker 9.1.0 changed how webpack rules are structured. The
findIndex approach was failing because it returned -1 when no SCSS
rule was found, causing "Cannot read properties of undefined".
Updated to use forEach pattern (matching main spec/dummy) which:
- Safely iterates through all rules
- Checks if rule.use is an array before accessing it
- Handles multiple SCSS rules if present
This fixes the build error:
"TypeError: Cannot read properties of undefined (reading 'push')"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 1370dcf commit 0d253df
File tree
1 file changed
+7
-4
lines changed- react_on_rails_pro/spec/dummy/config/webpack
1 file changed
+7
-4
lines changedLines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
0 commit comments