Skip to content

Commit d2042d5

Browse files
justin808claude
andcommitted
Fix async script loading for auto-generated component packs
The recent refactor to use async: true for non-Redux pages (c0a3b59) caused the image_example page to fail because of a timing issue between the main bundle and auto-generated component packs. The dummy app uses auto_load_bundle with components_subdirectory = "startup", which auto-generates packs for components like ImageExample. When the main client-bundle loads with async: true but auto-generated packs load with defer: true (the previous default), the defer scripts execute after async scripts, causing "Component already registered" errors or missing components. This commit changes generated_component_packs_loading_strategy from :defer to :async to match the main bundle loading strategy, ensuring proper execution order for non-Redux pages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c0a3b59 commit d2042d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/dummy/config/initializers/react_on_rails.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ def self.adjust_props_for_client_side_hydration(component_name, props)
4242
config.components_subdirectory = "startup"
4343
config.auto_load_bundle = true
4444
config.immediate_hydration = false
45-
config.generated_component_packs_loading_strategy = :defer
45+
config.generated_component_packs_loading_strategy = :async
4646
end

0 commit comments

Comments
 (0)