How to Write Bug Reports That Don't Make Maintainers Cry šš
How to Write Bug Reports That Don't Make Maintainers Cry šš
Real talk: I once received a bug report that said "Your library is broken. Fix it." No details. No error messages. No code examples. Just pure rage in text form. š¤
My response time? Approximately never. Because I'm not psychic!
As a full-time developer who contributes to open source, I've seen THOUSANDS of bug reports. The good ones get fixed in hours. The bad ones? They get closed with "cannot reproduce" or sit in issue purgatory forever!
Let me show you how to write bug reports that maintainers will LOVE to fix! šÆ
The Uncomfortable Truth About Bug Reports š£
What you think happens when you report a bug:
You: "It's broken!"
Maintainer: "Oh no! Let me drop everything and fix this!"
*bug fixed in 10 minutes*
What actually happens:
You: "It's broken!"
Maintainer: *reads vague description*
Maintainer: *spends 30 minutes trying to understand*
Maintainer: *can't reproduce*
Maintainer: "Need more info"
You: *never responds*
Maintainer: *closes issue after 2 weeks*
The stats that hurt:
- 68% of bug reports lack basic reproduction steps
- 54% don't include error messages
- 81% don't specify versions
- 43% of reporters never respond to follow-up questions
- ONE well-written bug report can save 3 hours of maintainer debugging time!
Translation: Most bug reports are terrible, and YOUR report is probably one of them! š¬
But hey! You clicked this post, which means you're about to become one of the GOOD ones! šŖ
The Bug Report Spectrum (Where Do You Fall?) šÆ
The "Useless" Bug Report ā
The classic:
Title: "Doesn't work"
Description:
Your library is broken. Please fix.
Why it's terrible:
- What doesn't work? Everything? One function? A specific feature?
- What did you expect to happen?
- What ACTUALLY happened?
- How can we reproduce this?
- Are you even using the latest version?
Maintainer's reaction: closes issue immediately or "Need more information"
Your bug gets: Ignored forever! š
The "Novel" Bug Report š
The other extreme:
Title: "Encountered an issue while implementing feature X in combination with Y when using Z on a Tuesday"
Description:
*5000 words of backstory*
*Your entire life story*
*Philosophy about software quality*
*Rant about other libraries*
*Somewhere buried in there: the actual bug*
*Maybe*
Why it's bad:
- TL;DR - maintainer gives up reading
- The actual bug is lost in noise
- Takes forever to parse
Maintainer's reaction: skims gets confused asks for clarification
The "Perfect" Bug Report ⨠(BE THIS ONE!)
The gold standard:
Title: "ParseError when using special characters in user input (v2.3.1)"
**Bug Description:**
The parseUserInput() function throws a ParseError when the input contains emoji characters.
**Expected Behavior:**
Should handle emoji characters gracefully or provide a clear validation error.
**Actual Behavior:**
Crashes with "ParseError: Unexpected token at position 5"
**Reproduction Steps:**
1. Call parseUserInput("Hello š World")
2. Observe the error
**Minimal Reproduction:**
```js
import { parseUserInput } from 'your-library'
const result = parseUserInput("Hello š World")
// Throws: ParseError: Unexpected token at position 5
Environment:
- Library version: 2.3.1
- Node version: 18.17.0
- OS: macOS 14.1
Error Stack Trace:
ParseError: Unexpected token at position 5
at parseUserInput (index.js:45:12)
at Object.<anonymous> (test.js:3:16)
Possible Solution: Looks like the regex on line 45 doesn't handle unicode characters. Maybe using /u flag would help?
**Why this is PERFECT:**
- ā
Clear, specific title with version
- ā
Describes what's expected vs. actual
- ā
Minimal reproduction code
- ā
All environment details
- ā
Full error trace
- ā
Even suggests a solution!
**Maintainer's reaction:** "This is beautiful! Let me fix this RIGHT NOW!" š
**Your bug gets:** Fixed in the next release! š
## The Golden Rules of Bug Reports š
### Rule #1: Do Your Homework First
**Before opening that issue:**
```markdown
ā” Search existing issues (maybe it's already reported!)
ā” Read the documentation (maybe you're using it wrong!)
ā” Check GitHub Discussions/Stack Overflow
ā” Try the latest version (maybe it's already fixed!)
ā” Test with minimal dependencies (isolate the problem!)
ā” Actually try to solve it yourself first
Real story:
"I was about to file a bug. Then I searched and found 3 existing issues about the same problem, one of which had a workaround. Saved everyone's time!" - Smart Developer
In the security community, we ALWAYS do recon before reporting vulnerabilities. Same principle applies to bugs! š
Rule #2: Reproduce It Consistently
If you can't reproduce it reliably, don't report it yet!
Bad:
"Sometimes the app crashes. Not sure when."
Good:
"App crashes 100% of the time when calling function X
with empty array as input on Node 18+"
How to find reproduction steps:
-
Isolate the problem:
- Does it happen with minimal code?
- Can you remove dependencies?
- What's the SMALLEST code that triggers it?
-
Test consistently:
- Does it happen every time?
- Or only under specific conditions?
-
Document the steps:
- Start from zero
- List EVERY step
- Include the commands
Example:
# Reproducible bug report
git clone https://github.com/user/repo
cd repo
npm install
npm run dev
# Navigate to /users
# Click "Delete" button
# Observe error in console
Balancing work and open source taught me this: I have limited time. A bug I can reproduce in 30 seconds gets fixed IMMEDIATELY. A bug that takes 30 minutes to understand gets... postponed indefinitely! ā°
Rule #3: Provide Environment Details
ALWAYS include:
## Environment
- Library/Package version: X.Y.Z (check package.json!)
- Language/Runtime version: Node 18.17.0 / Python 3.11 / etc.
- Operating System: macOS 14.1 / Ubuntu 22.04 / Windows 11
- Browser (if relevant): Chrome 120 / Firefox 121 / Safari 17
- Relevant dependencies: Express 4.18.2, React 18.2.0
Why this matters:
// This bug only happens on:
- Node 16 (not Node 18)
- Windows (not Mac/Linux)
- With specific dependency versions
// Without environment info, maintainer can't reproduce!
Pro tip: Use npx envinfo to generate environment details automatically! šÆ
Rule #4: Show, Don't Tell
Bad:
"The function doesn't work with large arrays"
Good:
"The sortArray() function takes 45 seconds with 100K items"
Reproduction:
const largeArray = Array.from({ length: 100000 }, (_, i) => i)
console.time('sort')
sortArray(largeArray)
console.timeEnd('sort')
// Output: sort: 45234.892ms
The power of code examples:
- ā Removes ambiguity
- ā Maintainer can copy-paste to test
- ā Proves you actually tried it
- ā Shows you understand the problem
Rule #5: Include the Error Message (Complete!)
Bad:
"Getting an error when I run the code"
Good:
"Getting TypeError when calling fetchUser():
TypeError: Cannot read property 'name' of undefined at fetchUser (src/api.js:23:18) at async loadUserProfile (src/components/Profile.js:45:21) at async handleLogin (src/auth.js:89:5)
Full console output: [link to pastebin/gist]
Pro tips:
# Copy the ENTIRE error (not just first line!)
# Include the stack trace
# Don't screenshot errors (text is better!)
# If it's long, use a gist/pastebin and link it
In my Laravel work, I learned this the hard way: The stack trace tells you EXACTLY where the bug is. Without it, you're flying blind! š¦
Rule #6: Provide a Minimal Reproduction
This is the MOST IMPORTANT rule!
The concept:
Minimal Reproduction = Smallest possible code that triggers the bug
NOT minimal:
"Clone my entire 50-file production app and run it"
Minimal:
// bug.js (5 lines)
const lib = require('your-library')
const result = lib.parse(null)
// Throws: TypeError
How to create a minimal reproduction:
- Start with your full code
- Remove everything unrelated
- Test - does bug still happen?
- Keep removing until you can't anymore
- You now have the minimal case!
Tools that help:
- CodeSandbox - For frontend bugs
- StackBlitz - For full-stack reproductions
- GitHub Gist - For simple scripts
- Replit - For quick tests
Example minimal reproduction:
Reproduction: https://codesandbox.io/s/bug-repro-abc123
Steps:
1. Open the sandbox
2. Click "Run"
3. See error in console
Maintainer's reaction: "I can click this link and see the bug IMMEDIATELY! Amazing!" š
Rule #7: Be Respectful and Constructive
Remember: You're asking volunteers for FREE help!
Bad:
ā "This is garbage! Who wrote this code?"
ā "Fix this NOW or I'm switching libraries"
ā "This is a critical production bug!" (for your personal project)
ā "A junior dev could fix this in 5 minutes"
Good:
ā
"Found a potential issue with the parser"
ā
"This might be affecting other users too"
ā
"Happy to provide more info if needed"
ā
"Thanks for maintaining this library!"
The tone difference:
Hostile: "Your library is broken"
Collaborative: "I think I found a bug"
Demanding: "Fix this ASAP"
Respectful: "Would appreciate help with this"
Rude: "This is obviously wrong"
Constructive: "Expected X but got Y"
Your attitude directly affects response time! Maintainers are human - they WANT to help nice people! š
The Perfect Bug Report Template š
Copy this for your next bug report:
**Bug Description:**
[One sentence: What's broken?]
**Expected Behavior:**
[What should happen?]
**Actual Behavior:**
[What actually happens?]
**Reproduction Steps:**
1. [First step]
2. [Second step]
3. [See error]
**Minimal Code Example:**
```js
// Smallest code that reproduces the bug
Environment:
- Package version:
- Runtime version:
- Operating System:
- Other relevant info:
Error Message/Stack Trace:
[Paste complete error here]
Screenshots (if relevant): [Add screenshots showing the bug]
Possible Cause/Solution: [Optional: Your investigation or suggested fix]
Additional Context: [Anything else relevant]
**Save this template!** Use it every time! šÆ
## Real Bug Report Examples (Learn from These!) š
### Example #1: Performance Bug
**ā Bad Report:**
```markdown
Title: "Slow performance"
Description:
Your library is really slow. Can you optimize it?
ā Good Report:
Title: "Performance degradation with large datasets (>10K items) - v3.2.1"
**Bug Description:**
The filterItems() function becomes unusably slow with datasets over 10,000 items.
**Expected Behavior:**
Should filter 10K items in under 100ms (like similar libraries)
**Actual Behavior:**
Takes 8+ seconds to filter 10K items
**Reproduction:**
```js
const items = Array.from({ length: 10000 }, (_, i) => ({
id: i,
name: `Item ${i}`
}))
console.time('filter')
const result = filterItems(items, { name: 'Item 5000' })
console.timeEnd('filter')
// Output: filter: 8234ms
Benchmark:
- 1K items: 80ms
- 10K items: 8234ms (100x slower!)
- 100K items: Freezes browser
Profiling: Looks like the issue is in the nested loop on line 156. Algorithm appears to be O(n²) instead of O(n).
Environment:
- Library: 3.2.1
- Node: 18.17.0
- Dataset: 10,000 objects with 2 properties each
Suggested Fix: Using a Map for lookups instead of nested arrays might help?
**Why this works:**
- ā
Quantifies the problem (8 seconds!)
- ā
Shows it scales badly
- ā
Includes benchmarks
- ā
Did profiling
- ā
Suggests solution
- ā
Clear reproduction
### Example #2: Crash/Error Bug
**ā Bad Report:**
```markdown
Title: "Error"
App crashes when I use your library
ā Good Report:
Title: "Null pointer exception in getUserById() when user doesn't exist - v1.5.2"
**Bug Description:**
Calling getUserById() with a non-existent ID throws an uncaught exception
instead of returning null or throwing a documented error.
**Expected Behavior:**
Should return null or throw a UserNotFoundError (as documented)
**Actual Behavior:**
Throws: TypeError: Cannot read property 'name' of undefined
**Reproduction:**
```js
import { getUserById } from 'your-library'
const user = await getUserById('non-existent-id')
// Expected: null or UserNotFoundError
// Actual: TypeError: Cannot read property 'name' of undefined
Error Stack Trace:
TypeError: Cannot read property 'name' of undefined
at getUserById (src/users.js:45:18)
at Object.<anonymous> (test.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
Root Cause: Line 45 in src/users.js assumes user object exists:
return user.name // Crashes if user is undefined!
Suggested Fix:
return user?.name ?? null // Safe navigation
Environment:
- Library: 1.5.2
- Node: 18.17.0
- Database: PostgreSQL 14
Additional Context: This happens when database returns no results. The docs say it should return null, but implementation doesn't handle this case.
**Why this is excellent:**
- ā
Exact error with stack trace
- ā
Expected vs actual clearly stated
- ā
Found the root cause (line 45!)
- ā
Provided fix
- ā
References documentation
- ā
Explains when it happens
### Example #3: Security Vulnerability
**ā ļø IMPORTANT: Don't publicly report security bugs!**
**Bad:**
```markdown
Title: "SQL injection vulnerability in your login code"
[Public issue with exploit details]
Good:
[Email maintainer privately or use [email protected]]
Subject: Security vulnerability in user authentication
I discovered a potential SQL injection vulnerability in the
login function. I've followed responsible disclosure:
1. Not posting publicly
2. Waiting for fix before disclosure
3. Providing details privately
Details:
[Vulnerability explanation]
[Proof of concept]
[Suggested fix]
Timeline:
- Discovered: Feb 6, 2026
- Waiting for: Fix + patch release
- Planning disclosure: 90 days after patch
Contact: [your email]
Why this is right:
- ā Private disclosure (not public issue!)
- ā Follows responsible disclosure
- ā Gives time to fix before public
- ā Provides details and fix
- ā Professional approach
In the security community, we ALWAYS use responsible disclosure. Publicly posting security bugs puts users at risk! š
Common Bug Report Mistakes (I've Made Them All!) šØ
Mistake #1: The "It Doesn't Work" Report
The trap:
Title: "Doesn't work"
Description: "I tried to use it and it doesn't work"
Why it fails: WHAT doesn't work? WHEN? HOW?
Fix: Be specific! "Function X throws error Y when called with Z"
Mistake #2: The "Works on My Machine" Dismissal
The scene:
Maintainer: "Can't reproduce this"
You: "Well it works on MY machine!"
*never provides environment details*
Fix: Provide COMPLETE environment info! Maybe it's specific to your setup!
Mistake #3: The Missing Reproduction
The problem:
"Here's my 500-line app. The bug is somewhere in there."
Fix: Create a 5-line minimal reproduction! Don't make maintainers dig through your codebase!
Balancing work and open source taught me: I have 30 minutes for OSS. If figuring out your bug takes 2 hours, I'll skip it. Make it EASY for me to help! š
Mistake #4: The Screenshot of Text
The horror:
[Blurry phone photo of laptop screen showing error message]
Why it's terrible:
- ā Can't copy-paste error to search
- ā Hard to read
- ā Missing context
- ā Looks unprofessional
Fix: COPY-PASTE text! Use screenshots only for UI bugs!
Mistake #5: The "Urgent" Demand
The entitlement:
"URGENT: Production is down! Fix in next 2 hours!"
Reality check:
- It's free software
- Maintained by volunteers
- Your emergency ā their emergency
- No SLA on open source!
Fix: Be patient and respectful. Or sponsor the maintainer for priority support! š°
Mistake #6: Version Ambiguity
The confusion:
"I'm using the latest version"
*latest version is actually 2 years old*
Fix: ALWAYS specify exact version numbers! 1.2.3, not "latest"!
Mistake #7: Too Many Issues at Once
The dump:
Title: "Multiple bugs found"
I found 15 bugs:
1. This doesn't work
2. That crashes
3. This is slow
4-15. More problems
Fix: ONE issue per bug report! Easier to track, discuss, and close individually!
The Follow-Up Etiquette š
When Maintainer Asks for More Info
ā Don't:
*never respond*
*or*
"I don't have time to provide that"
*or*
"Just fix it!"
ā Do:
"Sure! Here's the additional info you requested:
[detailed response]
Let me know if you need anything else!"
Remember: If you don't respond, your issue gets closed as "cannot reproduce"! š«
When They Suggest a Workaround
ā Don't:
"That's not a real fix! I want it PROPERLY fixed!"
ā Do:
"Thanks for the workaround! That unblocks me for now.
Should I keep this issue open for a permanent fix,
or close it since there's a workaround?"
Workarounds are GIFTS! They solve your problem NOW while permanent fix is planned! š
When They Close Your Issue
ā Don't:
"Why did you close this?! This is a real bug!"
*reopens aggressively*
ā Do:
"I see you closed this. Can you help me understand why?
I provided [reproduction/details]. Is there additional
info I can provide, or is this working as intended?"
Maybe there's a good reason! Or maybe they need clarification. Ask nicely! š¤
The Tools That Make Bug Reporting Easy š ļø
For Creating Reproductions
CodeSandbox - Frontend bugs
- Instant React/Vue/Angular sandbox
- Share link in bug report
- Maintainer can fork and fix
StackBlitz - Full-stack bugs
- Node.js backend support
- Multiple files
- Terminal access
Replit - Any language
- Supports 50+ languages
- Easy sharing
- Real-time collaboration
For Sharing Errors/Logs
GitHub Gist - Code snippets
- Syntax highlighting
- Version control
- Easy embedding
Pastebin/Hastebin - Quick pastes
- No account needed
- Expire after time
- Clean URLs
For Environment Info
npx envinfo - Auto-generate environment details
npx envinfo --system --binaries --npmPackages
# Outputs:
System:
OS: macOS 14.1
CPU: Apple M1
Binaries:
Node: 18.17.0
npm: 9.6.7
npmPackages:
react: 18.2.0
# ... all relevant packages
Just copy-paste this into bug reports! šÆ
For Screenshots/Videos
For UI bugs, screenshots help!
Tools:
- Loom - Record screen + voice explanation
- CleanShot - Annotated screenshots (Mac)
- ShareX - Screenshots + markup (Windows)
- Peek - GIF screen recorder (Linux)
Pro tip: Record a 30-second Loom showing the bug. Worth 1000 words! š¹
The Bug Report Workflow (From Discovery to Fix) š
Here's the full process:
Step 1: Discover Bug
"Hmm, this isn't working as expected..."
Step 2: Investigate
ā” Is it actually a bug or am I using it wrong?
ā” Check the documentation
ā” Search existing issues
ā” Try to understand the root cause
Step 3: Reproduce Consistently
ā” Find exact steps to trigger bug
ā” Create minimal reproduction
ā” Test multiple times
Step 4: Gather Information
ā” Environment details
ā” Error messages
ā” Code examples
ā” Screenshots if relevant
Step 5: Write Report
ā” Use issue template (if exists)
ā” Follow the perfect bug report format
ā” Be clear, specific, respectful
Step 6: Submit
ā” Choose relevant labels
ā” Add to project board (if exists)
ā” Don't assign it to yourself unless fixing it
Step 7: Engage Constructively
ā” Respond to follow-up questions promptly
ā” Test suggested fixes
ā” Provide feedback
ā” Say thank you when fixed!
Step 8: Close or Update
If fixed:
ā” Test the fix
ā” Confirm it works
ā” Close the issue
ā” Thank the maintainer!
If workaround exists:
ā” Document workaround
ā” Ask if should close or keep open
The Bottom Line š”
Good bug reports get fixed. Bad bug reports get ignored!
What you learned today:
- Do homework before reporting (search, update, test)
- Reproduce consistently with minimal code
- Provide complete environment details
- Include full error messages and stack traces
- Create minimal reproductions (CodeSandbox!)
- Be specific, clear, and respectful
- Follow up promptly when asked
- Use the perfect bug report template
- One bug per issue
- Your attitude affects response time!
The truth:
Good bug reports:
- ā Get fixed quickly
- ā Help other users too
- ā Build positive community
- ā Make maintainers happy
- ā Improve the project
- ā Save everyone time
Bad bug reports:
- ā Get ignored or closed
- ā Waste maintainer time
- ā Frustrate everyone
- ā Don't get fixed
- ā Damage community
- ā Make maintainers cry
Which are YOU writing? š¤
Your Action Plan š
Next time you find a bug:
- Search existing issues first
- Create minimal reproduction
- Gather all environment details
- Use the perfect template
- Be respectful and helpful
- Follow up on questions
- Thank the maintainer when fixed
This week:
- Review your past bug reports (cringe!)
- Update old reports with better info
- Close reports you can't reproduce anymore
- Help triage someone else's bug report
This month:
- Become known for excellent bug reports
- Help others write better reports
- Contribute fixes for bugs you report
- Build better relationships with maintainers
Going forward:
- ALWAYS use the template
- ALWAYS provide reproductions
- ALWAYS be respectful
- Watch your bugs get fixed faster! š
Resources You Need š
Templates:
- GitHub issue templates
- The template in this post
- Project-specific templates
Tools:
- CodeSandbox
- StackBlitz
- Loom
- npx envinfo
- GitHub Gist
Reading:
- How to Report Bugs Effectively
- Stack Overflow's MCVE
- Project-specific contribution guidelines
Examples of great bug trackers:
- Rust (excellent triage)
- React (clear templates)
- VS Code (detailed reports)
Go learn from them! š
Final Thoughts š
The uncomfortable truth:
Maintainers are drowning in badly-written bug reports. Yours is probably one of them!
But here's the good news:
By following this guide, YOUR bug reports will stand out! Maintainers will see your name and think "Oh good, this person writes EXCELLENT bug reports. Let me prioritize this!" š
The best part?
Writing good bug reports is a SKILL that makes you better at:
- Debugging (you learn to isolate problems!)
- Communication (clarity matters!)
- Empathy (you respect maintainers' time!)
- Contributing (first step to PRs!)
Your next bug report will be AMAZING! šŖ
So here's my challenge:
Right now, think of a bug you encountered recently. Write a proper bug report using this template. Even if you don't submit it, PRACTICE the skill!
Questions to ask yourself:
- Have I been writing terrible bug reports? (Probably yes!)
- Do I provide minimal reproductions? (Starting now!)
- Am I respectful to maintainers? (Always!)
- Can I improve my reporting skills? (Definitely!)
Your move! āļø
Ready to write amazing bug reports? Connect with me on LinkedIn - share your best bug report!
Want to see my reporting style? Check out my GitHub issues and PRs!
Now go write bug reports that get FIXED instead of ignored! šāØ
P.S. If you're a maintainer reading this: I feel your pain. Share this with your users! Maybe it'll reduce the "it doesn't work" reports! š
P.P.S. Remember: A great bug report is a GIFT to the maintainer. It shows you respect their time and want to help improve the project. Be the kind of contributor that maintainers LOVE to help! š