Act as an expert [language] debugger. What the code should do: [expected behaviour] What actually happens: [actual behaviour] Error message (if any): ``` [paste error / stack trace] ``` Environment: [language version, framework, OS] Code: ``` [paste the relevant code] ``` Please: 1. Identify the root cause (not just t…
Find and fix the bug, with an explanation
Share the code, the error and what you expected, and get the root cause, a minimal fix and tips to avoid the same bug in future.