{"record":{"id":"5e273dd682515fbb","repo":"facebook/docusaurus","slug":"author-socials-should-be-usernames-userids-handles","errorCode":null,"errorMessage":"Author socials should be usernames/userIds/handles, or fully qualified HTTP(s) absolute URLs.\nSocial platform '${platform}' has illegal value '${value}'","messagePattern":"Author socials should be usernames/userIds/handles, or fully qualified HTTP\\(s\\) absolute URLs\\.\nSocial platform '(.+?)' has illegal value '(.+?)'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-blog/src/authorsSocials.ts","lineNumber":58,"sourceCode":"  twitter: (handle: string) => `https://twitter.com/${handle}`,\n  github: (handle: string) => `https://github.com/${handle}`,\n  linkedin: (handle: string) => `https://www.linkedin.com/in/${handle}/`,\n  stackoverflow: (userId: string) =>\n    `https://stackoverflow.com/users/${userId}`,\n  bluesky: (handle: string) => `https://bsky.app/profile/${handle}`,\n  instagram: (handle: string) => `https://www.instagram.com/${handle}`,\n  threads: (handle: string) => `https://www.threads.net/@${handle}`,\n  mastodon: (handle: string) => `https://mastodon.social/@${handle}`, // can be in format user@other.server and it will redirect if needed\n  twitch: (handle: string) => `https://twitch.tv/${handle}`,\n  youtube: (handle: string) => `https://youtube.com/@${handle}`, // https://support.google.com/youtube/answer/6180214?hl=en\n  email: (email: string) => `mailto:${email}`,\n};\n\ntype SocialEntry = [string, string];\n\nfunction normalizeSocialEntry([platform, value]: SocialEntry): SocialEntry {\n  if (typeof value !== 'string') {\n    throw new Error(\n      `Author socials should be usernames/userIds/handles, or fully qualified HTTP(s) absolute URLs.\nSocial platform '${platform}' has illegal value '${value}'`,\n    );\n  }\n  const isAbsoluteUrl =\n    value.startsWith('http://') ||\n    value.startsWith('https://') ||\n    value.startsWith('mailto:');\n  if (isAbsoluteUrl) {\n    return [platform, value];\n  } else if (value.includes('/')) {\n    throw new Error(\n      `Author socials should be usernames/userIds/handles, or fully qualified HTTP(s) absolute URLs.\nSocial platform '${platform}' has illegal value '${value}'`,\n    );\n  }\n  const normalizer = PredefinedPlatformNormalizers[platform.toLowerCase()];\n  if (normalizer && !isAbsoluteUrl) {","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-blog/src/authorsSocials.ts#L40-L76","documentation":"Thrown by normalizeSocialEntry when an author social value is not a string (e.g. a number, boolean, or null parsed from YAML). The first guard in the function checks typeof value !== 'string'. The message names the offending platform key and value.","triggerScenarios":"An author's socials map has a non-string value, such as `stackoverflow: 82609` without quote-wrapping when Joi's coercion is bypassed, or `twitter: null`. Triggered while normalizing an author's socials during blog post processing.","commonSituations":"YAML auto-parses unquoted numbers/booleans, so `github: 12345` becomes a number. Authors map or front matter with a missing/null value or a list where a scalar is expected.","solutions":["Quote any purely-numeric handles in your YAML (e.g. `stackoverflow: \"82609\"`).","Remove null/empty social entries rather than leaving them blank.","Ensure each social value is a single string scalar, not a list or map."],"exampleFix":"# before\nstackoverflow: 82609\ntwitter:\n# after\nstackoverflow: \"82609\"\n# (remove the empty twitter line)","handlingStrategy":"validation","validationCode":"for (const [platform, value] of Object.entries(socials)) {\n  if (typeof value !== 'string') {\n    throw new Error(`Social '${platform}' must be a string, got ${typeof value}`);\n  }\n}","typeGuard":"const isStringSocials = (s: Record<string, unknown>): s is Record<string, string> =>\n  Object.values(s).every(v => typeof v === 'string');","tryCatchPattern":null,"preventionTips":["Quote numeric handles in YAML.","Avoid null/empty social entries; omit the key instead."],"tags":["blog","authors","socials","yaml","validation"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}