Skip to content

Commit 52362c5

Browse files
justin808claude
andcommitted
Fix Pro dummy webpack config scss undefined error
Applied the same fix as spec/dummy to prevent webpack config error when scss rule is not found in Shakapacker 9.3.0's generated config. Added guard check before attempting to push to the scss config's use array. Fixes build-dummy-app-webpack-test-bundles failure: TypeError: Cannot read properties of undefined (reading 'push') at commonWebpackConfig.js:32 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1f22eb9 commit 52362c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

react_on_rails_pro/spec/dummy/config/webpack/commonWebpackConfig.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const baseClientWebpackConfig = generateWebpackConfig();
2929
const scssConfigIndex = baseClientWebpackConfig.module.rules.findIndex((config) =>
3030
'.scss'.match(config.test),
3131
);
32-
baseClientWebpackConfig.module.rules[scssConfigIndex].use.push(sassLoaderConfig);
32+
if (scssConfigIndex !== -1 && baseClientWebpackConfig.module.rules[scssConfigIndex]?.use) {
33+
baseClientWebpackConfig.module.rules[scssConfigIndex].use.push(sassLoaderConfig);
34+
}
3335

3436
if (isHMR) {
3537
baseClientWebpackConfig.plugins.push(

0 commit comments

Comments
 (0)