Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork638
Description
Bug Description
Thebin/dev --verbose option is documented in the help text but is not actually implemented in the OptionParser, causing an error when users try to use it.
Steps to Reproduce
cd spec/dummy./bin/dev --verboseExpected Behavior
The command should run with verbose output for pack generation, showing the fullbundle exec rake react_on_rails:generate_packs output.
Actual Behavior
/lib/react_on_rails/dev/server_manager.rb:162:in `run_from_command_line': invalid option: --verbose (OptionParser::InvalidOption)Root Cause Analysis
The issue was introduced when therun_from_command_line method was refactored in commitce30d89 (#1790). The verbose parameter support was added earlier in commit3878825, but when the OptionParser was created in the later commit, the--verbose/-v flag parsing was not included.
Current State
- ✅ Help text documents
--verbose, -voption (line 218 inlib/react_on_rails/dev/server_manager.rb) - ✅
start()method acceptsverbose:parameter (line 11) - ✅ Verbose parameter is threaded through to
PackGenerator.generate()(lines 419, 426) - ✅
PackGeneratorcorrectly implements verbose output behavior - ❌ OptionParser in
run_from_command_line()does NOT parse--verboseor-v(lines 147-162) - ❌ All calls to
start()hardcodeverbose: false(lines 170, 172, 178)
Fix Required
Inlib/react_on_rails/dev/server_manager.rb, add to the OptionParser (around line 157):
opts.on("-v","--verbose","Enable verbose output for pack generation")dooptions[:verbose]=trueend
Then update thestart() calls to use the option:
# Line 170start(:production_like,nil,verbose:options[:verbose],route:options[:route],rails_env:options[:rails_env])# Line 172start(:static,"Procfile.dev-static-assets",verbose:options[:verbose],route:options[:route])# Line 178start(:development,"Procfile.dev",verbose:options[:verbose],route:options[:route])
And initialize the options hash with the verbose key (line 145):
options={route:nil,rails_env:nil,verbose:false}
Impact
- Users cannot enable verbose pack generation output
- Documentation misleads users about available options
- Debugging pack generation issues is harder than intended
Related Files
lib/react_on_rails/dev/server_manager.rb(lines 142-184)lib/react_on_rails/dev/pack_generator.rb(verbose support already implemented)lib/generators/react_on_rails/templates/base/base/bin/dev(template using this functionality)