Skip to content

Commit ff9cc79

Browse files
justin808claude
andcommitted
Fix CI failures by restoring packer availability check
- Restores using_packer? check to handle test scenarios where packer is disabled - Combines manifest.json check with packer availability in cleaner conditional - Reverts one inline Packer assignment that breaks when Shakapacker isn't loaded - Maintains original functionality while keeping code improvements All failing tests now pass: - webpack_assets_status_checker_spec.rb (all scenarios) - utils_spec.rb "without a packer enabled" scenarios 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 40dd365 commit ff9cc79

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/react_on_rails/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def self.bundle_js_file_path(bundle_name)
7272
# Priority order depends on bundle type:
7373
# SERVER BUNDLES (normal case): Try secure non-public locations first, then manifest, then legacy
7474
# CLIENT BUNDLES (normal case): Try manifest first, then fallback locations
75-
if bundle_name == "manifest.json"
75+
if bundle_name == "manifest.json" || !ReactOnRails::PackerUtils.using_packer?
7676
# Default to the non-hashed name in the specified output directory, which, for legacy
7777
# React on Rails, this is the output directory picked up by the asset pipeline.
7878
# For Shakapacker, this is the public output path defined in the (shaka/web)packer.yml file.

spec/react_on_rails/test_helper/webpack_assets_status_checker_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
let(:fixture_dirname) { "assets_with_manifest_exist_server_bundle_separate" }
6262

6363
before do
64-
Packer = Shakapacker # rubocop:disable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
64+
Packer = ReactOnRails::PackerUtils.packer # rubocop:disable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
6565
allow(ReactOnRails::PackerUtils).to receive_messages(
6666
manifest_exists?: true,
6767
packer_public_output_path: generated_assets_full_path

0 commit comments

Comments
 (0)