Summary
Users encounter a crash when accessing the organisation permissions page. The error TypeError: Cannot read properties of undefined (reading 'map') occurs when OrganisationStore.getProjects() returns undefined before data is loaded.
Sentry Issue
- FLAGSMITH-FRONTEND-48M - 76 events, 11 users affected
- First seen: 7/6/2025
- Last seen: 1/19/2026
- URL:
/organisation/{orgId}/permissions
Root Cause
In frontend/web/components/PermissionsTabs.tsx:43, the component assumes getProjects() always returns an array:
const projectData: Project[] = OrganisationStore.getProjects()
When line 126 tries to map over it:
mainItems={projectData.map((v) => ({ ...v, projectId: v.id }))}
If the store hasn't loaded yet, projectData is undefined and .map() crashes.
Proposed Fix
Add a fallback to empty array on line 43:
const projectData: Project[] = OrganisationStore.getProjects() || []
Acceptance Criteria
Summary
Users encounter a crash when accessing the organisation permissions page. The error
TypeError: Cannot read properties of undefined (reading 'map')occurs whenOrganisationStore.getProjects()returnsundefinedbefore data is loaded.Sentry Issue
/organisation/{orgId}/permissionsRoot Cause
In
frontend/web/components/PermissionsTabs.tsx:43, the component assumesgetProjects()always returns an array:When line 126 tries to map over it:
If the store hasn't loaded yet,
projectDataisundefinedand.map()crashes.Proposed Fix
Add a fallback to empty array on line 43:
Acceptance Criteria
|| []fallback when getting projects from store