Skip to content

Commit 664e514

Browse files
justin808claude
andcommitted
Fix: Properly access Pro configuration methods in ensure_webpack_generated_files_exists
The previous implementation used `respond_to?` to check for Pro-only methods (rsc_bundle_js_file, react_client_manifest_file, react_server_client_manifest_file) on the ReactOnRails::Configuration instance. However, these methods don't exist on the base Configuration class - they only exist on ReactOnRailsPro.configuration. This change follows the established pattern used in lib/react_on_rails/utils.rb:158-161 and lib/react_on_rails/packer_utils.rb:61-62 by: 1. Checking if Pro is available with ReactOnRails::Utils.react_on_rails_pro? 2. Accessing the Pro configuration object (ReactOnRailsPro.configuration) 3. Calling the Pro-specific methods on that object This ensures the code works correctly in both scenarios: - Open-source only: Pro check returns false, Pro files not added - With Pro loaded: Pro files are correctly added to webpack_generated_files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 38edb35 commit 664e514

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/react_on_rails/configuration.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,13 @@ def ensure_webpack_generated_files_exists
361361
return unless webpack_generated_files.empty?
362362

363363
files = ["manifest.json", server_bundle_js_file]
364-
files << rsc_bundle_js_file if respond_to?(:rsc_bundle_js_file)
365-
files << react_client_manifest_file if respond_to?(:react_client_manifest_file)
366-
files << react_server_client_manifest_file if respond_to?(:react_server_client_manifest_file)
364+
365+
if ReactOnRails::Utils.react_on_rails_pro?
366+
pro_config = ReactOnRailsPro.configuration
367+
files << pro_config.rsc_bundle_js_file
368+
files << pro_config.react_client_manifest_file
369+
files << pro_config.react_server_client_manifest_file
370+
end
367371

368372
self.webpack_generated_files = files.compact_blank
369373
end

0 commit comments

Comments
 (0)