Commit 7996fc4
Fix duplicate rake task execution by removing explicit task loading
Rails Engine automatically loads all .rake files from lib/tasks/ directory
via its run_tasks_blocks method. The explicit load calls in the rake_tasks
block caused each task file to be loaded twice:
1. Once via explicit load in rake_tasks block (Railtie layer)
2. Once via automatic loading by Rails::Engine
This resulted in tasks having duplicate action blocks, causing:
- react_on_rails:assets:webpack to run webpack build twice
- react_on_rails:generate_packs to run twice
- react_on_rails:locale to compile locales twice
The fix removes the explicit load calls and relies on Rails Engine's
standard auto-loading behavior from lib/tasks/*.rake, which already
works correctly for doctor.rake.
Verified that all tasks (assets:webpack, generate_packs, locale, doctor)
load correctly with exactly 1 action block each.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ae8b1b1 commit 7996fc4
1 file changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 86 | + | |
| 87 | + | |
91 | 88 | | |
92 | 89 | | |
0 commit comments