-
-
Notifications
You must be signed in to change notification settings - Fork 103
Improve error message when manifest is empty #872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When the dev server is starting and hasn't finished initial compilation, the manifest file is empty. Previously, users would see a confusing error listing 7 possible causes. Now, when the manifest is empty, users see a clear message that the bundler is still compiling with actionable next steps. Closes #871 Co-Authored-By: Claude Opus 4.5 <[email protected]>
WalkthroughDetects when the manifest is empty and raises a specific MissingEntryError describing that the bundler is still building (or the manifest is not yet built), instead of the previous generic missing-entry message. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Pull Request ReviewSummaryThis PR improves the user experience by detecting when the manifest file is empty and providing a clearer, more actionable error message. The implementation is clean, focused, and directly addresses issue #871. ✅ StrengthsCode Quality
Error Message Quality
Test Coverage
💡 SuggestionsMinor Enhancements
🔍 Technical ReviewPotential Issues: None Found
Code Path Analysis✅ Empty manifest ( 📋 Checklist
🎯 RecommendationAPPROVE - This is a high-quality PR that solves a real usability problem with a clean, focused implementation. The code is well-tested, follows project conventions, and significantly improves the user experience when encountering empty manifests during development. The suggestions above are minor and optional - the PR is solid as-is. Reviewed by Claude Code |
Greptile OverviewGreptile SummaryDetected when the manifest is empty (bundler still building) and replaced the confusing 7-point error list with a focused message explaining the bundler is still compiling.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ViewHelper
participant Manifest
participant HandleMissingEntry
User->>ViewHelper: Request asset (e.g., javascript_pack_tag)
ViewHelper->>Manifest: lookup!("application.js")
Manifest->>Manifest: compile() if needed
Manifest->>Manifest: lookup("application.js")
Manifest->>Manifest: find("application.js")
Manifest-->>Manifest: returns nil (not found)
Manifest->>HandleMissingEntry: handle_missing_entry(name, pack_type)
alt Manifest data is empty
HandleMissingEntry->>HandleMissingEntry: Check data.empty?
HandleMissingEntry->>HandleMissingEntry: manifest_empty_error()
HandleMissingEntry-->>User: Raise MissingEntryError<br/>"Manifest is empty. Bundler still compiling..."
else Manifest data exists
HandleMissingEntry->>HandleMissingEntry: missing_file_from_manifest_error()
HandleMissingEntry-->>User: Raise MissingEntryError<br/>"Can't find file in manifest. 7 possible causes..."
end
|
Update the error handling to provide different messages for: 1. Empty manifest file (bundler is still compiling) 2. Missing manifest file (bundler hasn't started yet) This gives users more actionable guidance based on the specific scenario. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Pull Request ReviewSummaryThis PR improves the error messaging when the manifest file is empty or missing, addressing issue #871. The implementation provides clearer, more actionable feedback to users instead of showing a confusing list of 7 possible causes. ✅ Strengths1. Excellent User Experience ImprovementThe new error messages are significantly more helpful:
2. Well-Structured Code
3. Comprehensive Test CoverageThe tests cover all critical scenarios:
4. Follows Project Conventions
🔍 Code Quality ObservationsMinor Considerations1. Early Return Check Location (lib/shakapacker/manifest.rb:158-160)The empty manifest check happens in
Recommendation: Current implementation is acceptable. No change needed. 2. Test Isolation (spec/shakapacker/manifest_spec.rb:9-10, 19-20, etc.)Tests stub Current approach: allow(Shakapacker.manifest).to receive(:data).and_return({})
allow(Shakapacker.config.manifest_path).to receive(:exist?).and_return(true)This works well and tests the right behavior. ✅ 3. Error Message ConsistencyThe error messages use different formatting styles:
Recommendation: Consider standardizing error message format across the codebase in a future PR (not blocking for this PR). 🐛 Potential IssuesNone FoundI did not identify any bugs, security concerns, or performance issues. 🧪 Test Coverage AnalysisCoverage: Excellent ✅ The tests cover:
Suggestions for additional testing (optional, not blocking):
🔒 Security ConsiderationsNo security concerns identified. ✅ The changes only affect error message generation and don't:
⚡ Performance ConsiderationsNo performance concerns. ✅
📋 Checklist ReviewBased on CLAUDE.md requirements:
📝 RecommendationsBefore Merge:
Future Improvements (not blocking):
🎯 Overall AssessmentLGTM! Excellent PR. ✅✅✅ This is a high-quality change that significantly improves the developer experience. The code is clean, well-tested, and solves a real user pain point. The implementation is thoughtful with proper differentiation between empty and missing manifest scenarios. Recommendation: Approve and merge after verifying:
Review completed by Claude Sonnet 4.5 🤖 |
Code ReviewSummaryThis PR improves error messaging when the manifest is empty or missing, helping users quickly identify whether the bundler is still compiling or hasn't run yet. The implementation is solid overall with good test coverage. ✅ Strengths
🔍 Issues Found1. Missing Trailing Newline
|
Summary
Test plan
bundle exec rspec spec/shakapacker/manifest_spec.rb- all 26 tests passbundle exec rubocopon changed files - no offensesCloses #871
🤖 Generated with Claude Code
Summary by CodeRabbit