{"record":{"id":"c6d4178361f1f811","repo":"DIYgod/RSSHub","slug":"username-does-not-exist-c6d417","errorCode":null,"errorMessage":"Username does not exist","messagePattern":"Username does not exist","errorType":"exception","errorClass":"InvalidParameterError","httpStatus":503,"severity":"warning","filePath":"lib/routes/twitch/video.ts","lineNumber":86,"sourceCode":"                operationName: 'ChannelVideoShelvesQuery',\n                variables: {\n                    channelLogin: login,\n                    first: 5,\n                },\n                extensions: {\n                    persistedQuery: {\n                        version: 1,\n                        sha256Hash: '7b31d8ae7274b79d169a504e3727baaaed0d5ede101f4a38fc44f34d76827903',\n                    },\n                },\n            },\n        ],\n    });\n\n    const channelVideoShelvesQueryData = response.data[0].data;\n\n    if (!channelVideoShelvesQueryData.user.id) {\n        throw new InvalidParameterError('Username does not exist');\n    }\n\n    const displayName = channelVideoShelvesQueryData.user.displayName;\n\n    const videoShelvesEdge = channelVideoShelvesQueryData.user.videoShelves.edges.find((edge) => edge.node.type === FILTER_NODE_TYPE_MAP[filter]);\n    if (!videoShelvesEdge) {\n        throw new InvalidParameterError(`No video under filter type \"${filter}\"`);\n    }\n\n    const out = videoShelvesEdge.node.items.map((item) => ({\n        title: item.title,\n        link: `https://www.twitch.tv/videos/${item.id}`,\n        author: displayName,\n        pubDate: parseDate(item.publishedAt),\n        description: `<img style=\"max-width: 100%;\" src=\"${item.previewThumbnailURL}\"><br/><img style=\"max-width: 100%;\" src=\"${item.animatedPreviewURL}\">`,\n        category: item.game && [item.game.displayName], // item.game may be null\n    }));\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/twitch/video.ts#L68-L104","documentation":"InvalidParameterError from the Twitch video route: the GQL `channelVideoShelvesQueryData.user.id` is falsy, meaning Twitch returned no user for the login. Treated as a bad parameter (login does not exist).","triggerScenarios":"Requesting `/twitch/video/:login` with a login Twitch does not recognize — line 85-87 throws after the GQL response comes back with no user.id.","commonSituations":"Login typo, deactivated/renamed channel, or a stale persistedQuery hash returning an empty user.","solutions":["Confirm the login exists at https://www.twitch.tv/{login}/videos.","Use the current login if the channel was renamed.","Verify the persistedQuery sha256Hash for ChannelVideoShelvesQuery is still valid."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!channelVideoShelvesQueryData?.user?.id) { throw new InvalidParameterError(`Twitch username does not exist: ${login}`); }","typeGuard":"const isTwitchUser = (u: unknown): u is { id: string; displayName: string } => typeof u === 'object' && u !== null && typeof (u as any).id === 'string';","tryCatchPattern":null,"preventionTips":["Validate the login format before the GQL call","Track the ChannelVideoShelvesQuery hash","Surface a 404 — not 500 — for unknown logins"],"tags":["twitch","graphql","invalid-parameter","user-not-found","video"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}