Strapi v5 admin: checkUserHasPermissions is not a function
Strapi v5 admin only loads Home, Marketplace and Settings after deploy, with "checkUserHasPermissions is not a function"? Causes and fixes to check.
The Liite team6 мин чтения
Short answer
The browser is not running the admin app's scripts cleanly. Check the console for CSP "Refused to execute a script" errors and find which proxy, CDN or Strapi setting sends that header. Then rebuild the admin and clear any cache that serves an old index.html. Strapi could not reproduce this report, so treat the steps below as a checklist, not one confirmed fix.
You deployed Strapi v5 to your own server and opened /admin. Only Home, Marketplace and Settings load, and the other pages stay empty. The browser console shows:
checkUserHasPermissions is not a function
Why it happens
The report behind this article is a Reddit thread plus GitHub issue #24760, from January 2026. People on the Strapi subreddit describe a self-hosted deploy of v5.33.1 on EC2. After the deploy only those three screens rendered. The console also showed CSP errors reading "Refused to execute a script". The poster said a fix turned up in the comments. Strapi said it could not reproduce the problem. No root cause has been confirmed, as far as we can tell.
What we can say is general. The admin panel is a JavaScript app, and a browser only runs scripts its policy allows. MDN explains that the primary use of CSP is to control which resources, in particular JavaScript resources, a document is allowed to load. If some admin scripts are blocked, or the page mixes files from two builds, a function the app expects can be missing. That would give a "... is not a function" error and some screens working while others don't. This is an inference from the symptoms, not something Strapi has confirmed.
Likely causes, most common first:
| Cause | Symptom | Fix |
|---|---|---|
| CSP header blocks admin scripts | "Refused to execute a script" in the console | Change the policy at its source (steps 1 and 2) |
| Stale or mismatched admin build | Error appears right after a deploy | Rebuild the admin (step 3) |
Mixed @strapi/* package versions | Missing-function errors on some screens | Clean reinstall (step 4) |
Cached index.html from an older build | Works for some people, not others | Purge the cache (step 5) |
| Browser extension | Only one browser or profile affected | Private window (step 6) |
Step-by-step fixes
Find and fix the CSP header
- Read the console errors in full. Open the browser developer tools and go to the Console tab. Each CSP message names the blocked URL and the directive that blocked it. Write both down. Microsoft's guide to spotting CSP violations says the same: the message names both the blocked URL and the directive that blocked it.
- Find where the header comes from. In the Network tab, click the request for the admin page and read its response headers for
Content-Security-Policy. MDN notes that a CSP should be delivered in the Content-Security-Policy response header. If nginx, a load balancer, a CDN or a security plugin adds it, change or remove it there. If Strapi sends it, review the security middleware settings in your Strapi config against the defaults in Strapi's docs for your version. - Allow the admin's own scripts. The policy needs to let scripts load from your admin's own origin. A
default-src 'self'policy is one that tells the browser to load only resources that are same-origin with the document. If your scripts come from a different host (a CDN, a separate asset domain), that host has to be inscript-src.
Don't leave CSP off
Removing the header is fine for a few minutes to confirm it is the cause. Then put back a policy that allows the admin's scripts instead of running without one.
Rebuild and reinstall
- Rebuild the admin on the server. Stop the app and delete the old admin build output. Run the admin build with the same Node version and the same installed dependencies you run in production, then start Strapi. A build made against different packages than the ones running can cause mismatches.
- Reinstall from your lockfile. Remove
node_modulesand install cleanly so every@strapi/*package is on one version. Mixed versions are a plausible source of missing-function errors, though nobody has confirmed that for this report. - Purge caches in front of Strapi. If a CDN or proxy serves an old
index.htmlthat points to script files from a previous build, the admin can break after a deploy. Purge it and hard-reload.
Rule out the browser and the environment
- Test in a private window or another browser. This rules out extensions that block scripts or change headers.
- Run the same build locally. If it works on your machine with the same Strapi version, the difference is on the server: headers, proxy, Node version or file permissions.
What won't help
- Clearing localStorage or logging out and in. A script failing to run is not a session problem.
- Reinstalling a plugin. The failure looks like it sits in how the admin loads, not in one plugin.
- Downgrading first. Try it only after the checks above. It can hide the cause, and it comes back at the next upgrade.
Checklist before you try again
- The console shows no "Refused to execute a script" lines after a hard reload.
- The
Content-Security-Policyheader, if present, allows the origin your admin scripts load from. - The admin was built with the Node version and dependencies that run in production.
- All
@strapi/*packages in the lockfile are on the same version. - Any CDN or proxy cache has been purged.
- A private window gives the same result as your normal browser.
If nothing works
Check whether the report has moved. Search the Strapi GitHub issues for the exact error text and for #24760, and read the release notes for versions newer than yours. If you can reproduce it on a clean install of the latest v5 release with default settings, add your details to that issue. Strapi said it could not reproduce it, so setup details are what the maintainers lack.
Include your Strapi and Node versions, the hosting setup, any proxy or CDN in front, the full console output, and the response headers of the /admin request. A message you can adapt:
Strapi v5.<version> admin does not load after deploy. Only Home, Marketplace
and Settings render. Console: "checkUserHasPermissions is not a function"
plus CSP "Refused to execute a script" errors.
Setup: self-hosted on <EC2 / VPS>, Node <version>, proxy/CDN: <nginx / none>.
Related to #24760. Tried: admin rebuild, clean reinstall, cache purge,
private window. Attached: console log and response headers of /admin.Common questions
Does this only happen on EC2?
The report was on EC2, but nothing we have seen ties the error to AWS. Any setup that sends a restrictive CSP header or serves a stale build could produce similar symptoms.
Is this a permissions problem with my admin user?
Probably not. The name suggests permissions, but "is not a function" means something the code calls is missing at runtime. It doesn't say your role lacks access. The CSP errors next to it point to blocked scripts.
Can a proxy change the CSP header?
Yes. A proxy, CDN or load balancer can add or replace response headers. Check the headers in the Network tab, as in step 2, to see which layer sets the one you receive.
Should I disable CSP completely?
Only briefly, to confirm it is the cause. Then restore a policy that allows the admin's own scripts.