Summary
react_on_rails:doctor can report false positives in apps where JavaScript dependencies live outside repo root (for example client/package.json) and webpack config is not at config/webpack/webpack.config.js.
What happens
Doctor reports errors/warnings like:
- missing
react-on-rails-pro / React deps in package.json
- missing webpack config at
config/webpack/webpack.config.js
...even when the app is correctly configured and running with Shakapacker + React on Rails Pro.
Root cause
Several checks are hardcoded to root paths:
package.json
config/webpack/webpack.config.js
Relevant code paths in 16.4.0.rc.9:
lib/react_on_rails/system_checker.rb (check_react_on_rails_npm_package, check_react_dependencies, check_webpack_configuration)
lib/react_on_rails/doctor.rb (check_key_configuration_files, check_npm_package_version, check_pro_package_consistency, etc.)
Expected behavior
Doctor should either:
- Discover paths from app config (for example Shakapacker root/config), or
- Treat these checks as non-critical heuristics when path assumptions don't match, with clear messaging.
Suggested approach
- Resolve package path from Shakapacker/React on Rails configuration when available.
- Avoid hard-failing on
config/webpack/webpack.config.js for custom/legacy setups.
- Report assumptions explicitly in output when falling back to root paths.
Why this matters
In mature/legacy repos with custom layout, current Doctor output can look like critical misconfiguration when setup is actually valid, reducing trust in diagnostics.
Summary
react_on_rails:doctorcan report false positives in apps where JavaScript dependencies live outside repo root (for exampleclient/package.json) and webpack config is not atconfig/webpack/webpack.config.js.What happens
Doctor reports errors/warnings like:
react-on-rails-pro/ React deps inpackage.jsonconfig/webpack/webpack.config.js...even when the app is correctly configured and running with Shakapacker + React on Rails Pro.
Root cause
Several checks are hardcoded to root paths:
package.jsonconfig/webpack/webpack.config.jsRelevant code paths in
16.4.0.rc.9:lib/react_on_rails/system_checker.rb(check_react_on_rails_npm_package,check_react_dependencies,check_webpack_configuration)lib/react_on_rails/doctor.rb(check_key_configuration_files,check_npm_package_version,check_pro_package_consistency, etc.)Expected behavior
Doctor should either:
Suggested approach
config/webpack/webpack.config.jsfor custom/legacy setups.Why this matters
In mature/legacy repos with custom layout, current Doctor output can look like critical misconfiguration when setup is actually valid, reducing trust in diagnostics.