Skip to content

fix: getComponents .map is not a function TypeError - #158

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/components-map-typeerror
Open

fix: getComponents .map is not a function TypeError#158
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/components-map-typeerror

Conversation

@sentry

@sentry sentry Bot commented Aug 2, 2026

Copy link
Copy Markdown

This PR fixes a TypeError: (intermediate value)(intermediate value)(intermediate value).map is not a function occurring in the getComponents function within src/content/github/common/fetchers.ts.

The root cause was that getComponents was attempting to call .map() directly on the response.data object, which for the components API endpoint, is a paginated response of the form {results: [...], count: N}. Therefore, response.data was an object, not an array, leading to the TypeError.

The fix involves changing response.data to response.data.results on line 38 of src/content/github/common/fetchers.ts. This ensures that the .map() function is called on the actual array of components, consistent with how the getFlags function in the same file handles similar paginated API responses.

Fixes BROWSER-EXTENSION-1K

@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 8 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
codecov-browser-extension-array-push 649.09kB 8 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: codecov-browser-extension-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
githubFile.js 8 bytes 11.51kB 0.07%

Files in githubFile.js:

  • ./src/content/github/common/fetchers.ts → Total Size: 2.44kB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant