diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000000000000000000000000000000000000..766d73e430f75deb0cefba0549e1378c784c3cb4
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,9 @@
+{
+    "name": "drupal/fpa",
+    "type": "drupal-module",
+    "description": "Fast filtering on permissions administration form.",
+    "require": {
+        "drupal/core": "^9.4 | ^10.3 | ^11",
+        "drupal/js_cookie": "^1.0"
+    }
+}
diff --git a/fpa.info.yml b/fpa.info.yml
index e556847843affbb1f3936db938e99c3b0b6541ed..3f7a22c5b81d8cfa0bdc0b253dee9835aa5d968b 100644
--- a/fpa.info.yml
+++ b/fpa.info.yml
@@ -1,5 +1,5 @@
 name: Fast Permissions Administration
 type: module
 description: Fast filtering on permissions administration form.
-core_version_requirement: ^9.4 || ^10.0
+core_version_requirement: ^9.4 || ^10.0 || ^11
 package: Administration
diff --git a/fpa.libraries.yml b/fpa.libraries.yml
index 4ec905d4be561b84816b9101c0bd2dd583c71979..818b2368c85168ef1ee9b811fc162a88e2f39bcb 100644
--- a/fpa.libraries.yml
+++ b/fpa.libraries.yml
@@ -9,5 +9,5 @@ fpa.permissions:
     - core/jquery
     - core/drupal
     - core/drupalSettings
-    - core/js-cookie
-    - core/drupal.user.permissions
\ No newline at end of file
+    - core/drupal.user.permissions
+    - js_cookie/js-cookie
diff --git a/src/FpaFormBuilder.php b/src/FpaFormBuilder.php
index bdd7733242dc8cafd4e4b4e6d187277e8a70894d..97f3ca3100b935a863ab3dcaa8657677586cd140 100644
--- a/src/FpaFormBuilder.php
+++ b/src/FpaFormBuilder.php
@@ -9,6 +9,7 @@ use Drupal\Core\Link;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Render\Element\Checkboxes;
 use Drupal\Core\Url;
+use Drupal\user\Entity\Role;

 /**
  * Class FpaFormBuilder.
@@ -28,7 +29,8 @@ class FpaFormBuilder {
   public static function getRequiredMemory($suffix = '') {
     $permission = \Drupal::service('user.permissions');
     $permissions_count = count($permission->getPermissions());
-    $user_roles_count = count(user_roles());
+    $roles = Role::loadMultiple();
+    $user_roles_count = count($roles);
     $page_ram_required = (9 * 1024 * 1024);
     // Takes ~26kb per row without any checkboxes.
     $permission_row_overhead = 27261.028783658;
