A skill for using Copilot to quickly diagnose and fix compilation errors, runtime exceptions, and test failures.
## Copilot Error Fix Skill ### Overview Use Copilot's error-fixing capabilities to quickly resolve build errors, runtime exceptions, and test failures. ### Method 1: Inline Error Fix When your editor shows an error, use the Copilot quick fix: 1. Hover over the red squiggly underline 2. Click the lightbulb icon or press `Ctrl+.` 3. Select "Fix using Copilot" from the suggestions 4. Review and accept the proposed fix ### Method 2: Terminal Error Fix When a command fails in the terminal: 1. Copilot detects the error output automatically 2. Click the sparkle icon next to the error in the terminal 3. Or copy the error and paste into Copilot Chat with: "Fix this error:" 4. Copilot analyzes the stack trace and suggests a fix ### Method 3: Chat-Based Diagnosis For complex errors, provide full context to Copilot Chat: ``` I'm getting this error when running my tests: [paste full error output with stack trace] The relevant code is in the selected file. What is causing this error and how do I fix it? ``` ### Common Error Patterns and Fixes **TypeScript Type Errors:** - "Type X is not assignable to type Y" -> Check type definitions and add proper type guards - "Property does not exist on type" -> Add optional chaining or extend the interface - "Cannot find module" -> Check import path, file extension, or install missing package **Runtime Errors:** - "Cannot read properties of undefined" -> Add null check before property access - "Maximum call stack size exceeded" -> Find and break the recursive loop - "ECONNREFUSED" -> Check that the dependent service is running **Build Errors:** - "Module not found" -> Install dependency or fix import path - "Unexpected token" -> Check syntax, missing brackets, or incompatible JS version - "Out of memory" -> Increase Node heap size or optimize build configuration **Test Failures:** - "Expected X but received Y" -> Check test data setup and assertion values - "Timeout" -> Add await for async operations or increase timeout - "Cannot find element" -> Update selectors or add wait conditions ### Batch Error Resolution When multiple errors are related: ``` I have 15 TypeScript errors after upgrading from React 18 to React 19. Here are the error messages: [paste errors] Provide a systematic fix for all of them. ``` ### Prevention After fixing an error, ask Copilot: - "How can I prevent this type of error in the future?" - "Should I add a lint rule to catch this pattern?" - "Write a test that would catch this regression"
Free to copy and use. Compatible with GitHub Copilot, GPT-5.
When you encounter errors, use the inline quick fix (Ctrl+.) for simple errors or Copilot Chat for complex stack traces. Always review the suggested fix before accepting.
Initial release
Sign in and download this prompt to leave a review.