Skip to content

Unhandled Runtime Error: permission is undefined in GroupsProvider.tsx #476

@rasandilikshana

Description

@rasandilikshana

Describe the problem
When navigating to the Peers page (http://localhost:3000/peers), an unhandled runtime error occurs due to an undefined permission object being accessed inside the GroupsProvider.tsx file.


To Reproduce
Steps to reproduce the behavior:

  1. Start the NetBird dashboard locally.
  2. Navigate to http://localhost:3000/peers.
  3. Wait for the page to render.
  4. Observe the runtime error in the browser console or screen.

Expected behavior
The Peers page should load normally without throwing any runtime error. The permission.groups.read access should be safely handled or verified for presence before use.


Are you using NetBird Cloud?
Self-hosted instance of NetBird


NetBird version
v2.14.0 (latest release)


Error Stack

Unhandled Runtime Error  
TypeError: permission is undefined  
Source: src/contexts/GroupsProvider.tsx (line 49)

  47 |     mutate,
  48 |     isLoading,
> 49 |   } = useFetchApi<Group[]>("/groups", false, true, permission.groups.read);
     |                                                    ^
  50 |   const groupRequest = useApiCall<Group>("/groups", true);
  51 |   const [dropdownOptions, setDropdownOptions] = useState<Group[]>([]);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions