zed-industries/zed · warning · Error
Unknown method: ${method}
Error message
Unknown method: ${method} What it means
The third path segment of a github.com URL must be the literal 'blob' for the importer to convert it into a raw URL. URLs whose segment is 'tree', 'commits', 'releases', 'raw', and so on are rejected because they point at a listing or metadata page, not a file.
Source
Thrown at crates/prettier/src/prettier_server.js:237
`Resolved config: ${JSON.stringify(resolvedConfig)}, will format file '${
params.options.filepath || ""
}' with options: ${JSON.stringify(options)}\n`,
);
const formattedText = await prettier.prettier.format(params.text, options);
sendResponse({ id, result: { text: formattedText } });
} else if (method === "prettier/clear_cache") {
prettier.prettier.clearConfigCache();
prettier.config = (await prettier.prettier.resolveConfig(prettier.path)) || {};
sendResponse({ id, result: null });
} else if (method === "initialize") {
sendResponse({
id,
result: {
capabilities: {},
},
});
} else {
throw new Error(`Unknown method: ${method}`);
}
}
function makeError(message) {
return {
error: {
code: -32600, // invalid request code
message,
},
};
}
function sendResponse(response) {
const responsePayloadString = JSON.stringify({
jsonrpc: "2.0",
...response,
});
const headers = `${contentLengthHeaderName}: ${Buffer.byteLength(View on GitHub (pinned to f4178619ac)
Solutions
- Click the actual .md file in the tree so the URL contains /blob/, then copy it
- Or hand-edit the URL, replacing 'tree' with 'blob', keeping the same ref and path
Example fix
# before https://github.com/acme/skills/tree/main/src/SKILL.md # after https://github.com/acme/skills/blob/main/src/SKILL.md
Defensive patterns
Strategy: validation
Validate before calling
let segments: Vec<&str> = url.path_segments().map(Iterator::collect).unwrap_or_default(); ensure!(segments.get(2) == Some(&"blob"), "Paste a GitHub blob URL that points to a .md file");
Type guard
fn is_blob_kind(url: &url::Url) -> bool {
url.path_segments()
.and_then(|s| s.nth(2))
.map(|kind| kind == "blob")
.unwrap_or(false)
} Prevention
- Reject /tree/, /commits/, /releases/ URLs client-side with a hint to open the file itself
- Auto-suggest replacing 'tree' with 'blob' in the import UI
When it happens
Trigger: Pasting github.com/owner/repo/tree/main/docs (directory listing), github.com/owner/repo/commits/main, github.com/owner/repo/releases/tag/v1, or any URL where the kind segment differs from 'blob'.
Common situations: The user copied the address bar while browsing a folder (tree view) instead of an opened file; clicking through GitHub UI leaves /tree/ in the URL.
Related errors
- Message params.options is undefined: ${JSON.stringify(messag
- eval-cli binary not found at {binary}. Build it with: cargo
- Message params.text is undefined: ${JSON.stringify(message)}
- Message method is undefined: ${JSON.stringify(message)}
- Message id is undefined: ${JSON.stringify(message)}
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/cdea80b3023573f8.
Report an issue: GitHub.