{"record":{"id":"0427b7a50d863d8c","repo":"Kong/insomnia","slug":"unable-to-get-stars-from-github-api","errorCode":null,"errorMessage":"unable to get stars from GitHub API","messagePattern":"unable to get stars from GitHub API","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/ui/components/github-stars-button.tsx","lineNumber":32,"sourceCode":"  const initialState = Number.parseInt(localStorageStars || '30000', 10);\n  const [starCount, setStarCount] = useState(initialState);\n\n  useEffect(() => {\n    localStorage.setItem(LOCALSTORAGE_GITHUB_STARS_KEY, String(starCount));\n  }, [starCount]);\n\n  const [error, setError] = useState<Error | null>(null);\n\n  reactUse.useMount(() => {\n    if (!isMounted()) {\n      return;\n    }\n\n    fetch(`${getGitHubRestApiUrl()}/repos/Kong/insomnia`)\n      .then(data => data.json())\n      .then(info => {\n        if (!('watchers' in info)) {\n          throw new Error('unable to get stars from GitHub API');\n        }\n\n        if (!isMounted()) {\n          return;\n        }\n\n        setStarCount(info.watchers);\n        setError(null);\n      })\n      .catch(error => {\n        if (!isMounted()) {\n          return;\n        }\n\n        console.error('error fetching GitHub stars', error);\n        setError(error);\n      });\n  });","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/ui/components/github-stars-button.tsx#L14-L50","documentation":"Thrown in GitHubStarsButton's mount effect when the GitHub REST API response for Kong/insomnia does not include a `watchers` field — i.e. the request succeeded at fetch level but returned an unexpected payload (rate-limit or error JSON body), so no star count can be derived. The component then shows the error state.","triggerScenarios":"Thrown at packages/insomnia/src/ui/components/github-stars-button.tsx:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry later; GitHub API rate limits commonly cause non-star payloads for unauthenticated requests","Check network/proxy availability to api.github.com","The UI already falls back to the last cached count from localStorage, so this is non-fatal"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","contentChangedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}