{"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":"Error \"unable to get stars from GitHub API\" thrown in Kong/insomnia.","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":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}