Quick Answer: How to Fix the “ParseFailed” Token Error
If your IDE is throwing the failed to get copilot token. parsefailed error, it means GitHub Copilot received an HTML error page (usually from a corporate firewall or VPN) instead of the expected JSON authentication token. To fix this immediately:
- Disable Corporate VPNs: Temporarily disconnect from your VPN (like Zscaler, Cisco AnyConnect, or GlobalProtect) to see if the proxy is intercepting the SSL certificate.
- Update Your IDE & Extension: Ensure both VS Code/IntelliJ and the GitHub Copilot extension are updated to their absolute latest versions to fix known API parsing bugs.
- Sign Out and Sign Back In: Click the accounts icon in your IDE, completely sign out of GitHub, restart the editor, and sign back in to force a fresh token generation.
- Configure Proxy Settings: If you must use a proxy, ensure your IDE’s
http.proxysettings are correctly configured to allow traffic toapi.github.com.
AI coding assistants have revolutionized the way we write software, making it incredibly frustrating when they suddenly stop working. If you are a developer using Visual Studio Code, IntelliJ, or Visual Studio, you might have encountered a sudden roadblock where GitHub Copilot stops suggesting code and instead displays a cryptic output log message: “failed to get copilot token. parsefailed”.
Unlike standard login failures, a parsefailed error is a very specific type of network miscommunication. Your IDE successfully reached a server, but the response it got back was gibberish to the Copilot extension. In this comprehensive technical guide, we will break down exactly why this JSON parsing failure occurs, how corporate firewalls break Copilot, and the step-by-step methods to get your AI assistant back online.
Why Does the “ParseFailed” Error Happen?
To fix the error, you need to understand how Copilot authenticates. When you open your IDE, the Copilot extension reaches out to api.github.com to request a temporary access token. The API is supposed to reply with a neatly formatted JSON (JavaScript Object Notation) file containing your token.
However, if a network appliance intercepts that request, things go wrong. The most common scenarios include:
- The Captive Portal Intercept: You are on a public Wi-Fi network (like a hotel or cafe) that requires you to click “Agree” on a web page before accessing the internet. The Copilot extension receives this HTML web page instead of a JSON token and fails to parse it.
- Corporate SSL Decryption: Security tools like Zscaler or Netskope decrypt and inspect web traffic. If they block the GitHub API request or inject a custom SSL warning page, the IDE receives HTML instead of JSON.
- Outdated Extension Logic: GitHub occasionally updates their backend API payload structure. If you are using a very old version of the Copilot extension, it may no longer know how to parse the modern JSON response.
Troubleshooting Matrix for Copilot Token Errors
Use the matrix below to identify the most likely fix based on your current development environment:
Advanced Fix: Configuring VS Code Proxy Settings
If you are forced to work behind a corporate proxy and cannot turn off your VPN, you must tell your IDE how to route the Copilot traffic. In VS Code, press Ctrl + Shift + P, search for Preferences: Open User Settings (JSON), and ensure your proxy is defined:
“http.proxyStrictSSL”: false,
Experiencing other IDE connection problems? Read our internal guide on How to Fix VS Code Extension Installation Errors. For official network endpoints, always consult the Official GitHub Copilot Network Troubleshooting Guide.
Related Topics
- “failed to get copilot token. parsefailed VS Code”
Keyword Intent: Specific Editor Troubleshooting. Explanation: VS Code users encountering the parsing error. Short Answer: The Copilot extension received an HTML block instead of JSON. Click the profile icon in the bottom left, sign out of GitHub, and sign back in to refresh the token cache. - “GitHub Copilot Zscaler parse error”
Keyword Intent: Security Software Conflict. Explanation: Zscaler is intercepting the GitHub API call for SSL inspection. Short Answer: You must ask your IT department to whitelistcopilot-proxy.githubusercontent.comandapi.github.comin the Zscaler control panel so the traffic is not intercepted. - “GitHub Copilot token refresh failed”
Keyword Intent: Authentication Loop. Explanation: The token has naturally expired, but the IDE cannot fetch a new one. Short Answer: Manually revoke VS Code’s access from your GitHub web settings under “Applications”, then re-authenticate your IDE from scratch. - “Copilot extension returning unexpected token < in JSON at position 0”
Keyword Intent: Code-Level Error Diagnosis. Explanation: This is the literal developer console output of a parsefailed error. Short Answer: The `<` symbol means the IDE tried to read an HTML tag (like<html>) instead of a JSON curly brace ({). A firewall or proxy is blocking the real response. - “Is GitHub Copilot down right now?”
Keyword Intent: Server Status Check. Explanation: Users verifying if the parse error is their fault or GitHub’s. Short Answer: While rare, backend API outages at GitHub can cause token generation failures. Always check the official GitHub Status page before altering your local proxy settings.
TL;DR – Key Takeaways for the ParseFailed Error
- The parsefailed error means Copilot tried to read a JSON authentication token but received an HTML webpage instead.
- The most common cause is a corporate VPN, Zscaler, or proxy blocking access to the GitHub API endpoints.
- If you are not on a VPN, a simple Sign Out > Restart IDE > Sign In fixes the issue 90% of the time.
- Ensure your IDE (VS Code, Visual Studio, or JetBrains) and the Copilot extension are fully updated to prevent legacy code conflicts.