{"record":{"id":"dcc5eecce17689f0","repo":"jackwener/OpenCLI","slug":"no-posts-were-returned-for-user-args-username","errorCode":null,"errorMessage":"No posts were returned for user ${args.username}. Confirm the username and login state.","messagePattern":"No posts were returned for user (.+?)\\. Confirm the username and login state\\.","errorType":"exception","errorClass":"EmptyResultError('jike user')","httpStatus":null,"severity":"warning","filePath":"clis/jike/user.js","lineNumber":45,"sourceCode":"  try {\n    const data = JSON.parse(el.textContent || '{}');\n    const posts = Array.isArray(data?.props?.pageProps?.posts) ? data.props.pageProps.posts : [];\n    return posts.map(p => ({\n      content: (p.content || '').replace(/\\\\n/g, ' ').slice(0, 80),\n      type: p.type === 'ORIGINAL_POST' ? 'post' : p.type === 'REPOST' ? 'repost' : p.type || '',\n      likes: p.likeCount || 0,\n      comments: p.commentCount || 0,\n      time: p.actionTime || p.createdAt || '',\n      id: p.id || '',\n    }));\n  } catch (e) {\n    return { ok: false, reason: 'parse-error', message: e?.message || String(e) };\n  }\n})()\n`);\n        if (Array.isArray(data)) {\n            if (data.length === 0) {\n                throw new EmptyResultError('jike user', `No posts were returned for user ${args.username}. Confirm the username and login state.`);\n            }\n            return data.slice(0, limit).map((item) => ({\n                id: item.id ?? '',\n                content: item.content ?? '',\n                type: item.type ?? '',\n                likes: item.likes ?? 0,\n                comments: item.comments ?? 0,\n                time: item.time ?? '',\n                url: `https://web.okjike.com/originalPost/${item.id ?? ''}`,\n            }));\n        }\n        if (data?.reason === 'missing-data-script') {\n            throw new CommandExecutionError('Jike user page did not expose the expected data script');\n        }\n        if (data?.reason === 'parse-error') {\n            throw new CommandExecutionError(`Failed to parse Jike user data: ${data.message || 'unknown error'}`);\n        }\n        throw new CommandExecutionError('Jike user returned an unreadable payload');","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/jike/user.js#L27-L63","documentation":"EmptyResultError thrown when the Jike user page scrape returns a successful JSON array with zero posts. The CLI treats an empty result as a distinct condition so the user knows the extraction worked but matched nothing, typically because the username is wrong or the account requires login to view posts.","triggerScenarios":"Running the `jike user` command with a username whose profile returns no post data: a nonexistent or misspelled username, a private/restricted account, or a logged-out page where Jike hides original posts.","commonSituations":"Typo in the username argument; scraping an account with no public original posts; Jike web serving a login wall for anonymous visitors; a username that was changed or deactivated.","solutions":["Verify the username by opening https://web.okjike.com/<username> in a browser and confirming posts appear","Log into Jike in the browser session (or the persisted profile) so authenticated content is visible","Try a different username to confirm the target account actually has original posts","Retry later if Jike is serving an empty/degraded page"],"exampleFix":"// before\nawait jikeUser({ username: 'nonexistent_user', limit: 10 });\n// after\n// verify in browser first\nawait jikeUser({ username: 'correct_username', limit: 10 });","handlingStrategy":"try-catch","validationCode":"const u = args.username;\nif (!u || typeof u !== 'string' || !/^[A-Za-z0-9_-]+$/.test(u)) {\n  throw new Error('Provide a valid Jike username');\n}","typeGuard":"function hasPosts(d) { return Array.isArray(d) && d.length > 0; }","tryCatchPattern":"try {\n  const posts = await jikeUser({ username, limit });\n} catch (e) {\n  if (e.name === 'EmptyResultError') console.warn(`No posts for ${username}; check username/login`);\n  else throw e;\n}","preventionTips":["Verify the username resolves to a public profile in a browser first","Keep the browser session logged into Jike so authenticated posts are visible","Confirm the account has original posts, not only reposts/comments"],"tags":["scraping","empty-result","authentication"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}