{"record":{"id":"c82d424dca69781f","repo":"zed-industries/zed","slug":"message-params-text-is-undefined-json-stringify","errorCode":null,"errorMessage":"Message params.text is undefined: ${JSON.stringify(message)}","messagePattern":"Message params\\.text is undefined: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"crates/prettier/src/prettier_server.js","lineNumber":167,"sourceCode":"async function handleMessage(message, prettier) {\n  const { method, id, params } = message;\n  if (method === undefined) {\n    throw new Error(`Message method is undefined: ${JSON.stringify(message)}`);\n  } else if (method == \"initialized\") {\n    return;\n  } else if (method === \"shutdown\") {\n    sendResponse({ result: {} });\n  } else if (method == \"exit\") {\n    process.exit(0);\n  }\n\n  if (id === undefined) {\n    throw new Error(`Message id is undefined: ${JSON.stringify(message)}`);\n  }\n\n  if (method === \"prettier/format\") {\n    if (params === undefined || params.text === undefined) {\n      throw new Error(`Message params.text is undefined: ${JSON.stringify(message)}`);\n    }\n    if (params.options === undefined) {\n      throw new Error(`Message params.options is undefined: ${JSON.stringify(message)}`);\n    }\n\n    let resolvedConfig = {};\n    if (params.options.filepath) {\n      resolvedConfig = (await prettier.prettier.resolveConfig(params.options.filepath, { editorconfig: true })) || {};\n\n      if (params.options.ignorePath) {\n        const fileInfo = await prettier.prettier.getFileInfo(params.options.filepath, {\n          ignorePath: params.options.ignorePath,\n        });\n        if (fileInfo.ignored) {\n          process.stderr.write(\n            `Ignoring file '${params.options.filepath}' based on rules in '${params.options.ignorePath}'\\n`,\n          );\n          sendResponse({ id, result: { text: params.text } });","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/prettier/src/prettier_server.js#L149-L185","documentation":"github_raw_url accepts only two hosts: github.com (blob URLs) and raw.githubusercontent.com (raw file URLs). Any other host in the pasted URL is rejected with this message before parsing continues. It is a whitelist check in the skill-import input validation.","triggerScenarios":"The URL host is neither github.com nor raw.githubusercontent.com: gist.github.com/..., gist.githubusercontent.com/..., gitlab.com/..., cdn.jsdelivr.net/..., bitbucket.org/...","commonSituations":"The skill file lives in a GitHub gist, on GitLab, or behind a CDN/mirror; the user pasted the repo home page of a different forge; the URL was copied from a docs site that embeds GitHub content.","solutions":["Open the file inside its GitHub repository and copy the github.com blob URL","For raw links, use the Raw button on the GitHub file page, which yields a raw.githubusercontent.com URL","If the file is only on another forge, move or mirror it to github.com first"],"exampleFix":"# before\nhttps://gist.github.com/acme/abc123/repo\n\n# after\nhttps://github.com/acme/skills/blob/main/SKILL.md","handlingStrategy":"validation","validationCode":"let url = url::Url::parse(input.trim())?;\nensure!(\n    matches!(url.host_str(), Some(\"github.com\") | Some(\"raw.githubusercontent.com\")),\n    \"Paste a GitHub .md URL\"\n);","typeGuard":"fn is_github_host(input: &str) -> bool {\n    url::Url::parse(input.trim())\n        .ok()\n        .and_then(|u| u.host_str().map(|h| h == \"github.com\" || h == \"raw.githubusercontent.com\"))\n        .unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Whitelist github.com and raw.githubusercontent.com in the UI hint so users self-correct before submitting","For gists, link the underlying repo file instead of the gist page"],"tags":["url-validation","github","host-whitelist"],"backgroundTag":"unsupported-url-host","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}