Thank you for reaching out to Microsoft Q&A forum
Based on your description, I understand that your custom component renders, but list queries return empty on certain site collections, and the web part fails on pages from different site templates. As far as I know, in SharePoint, this typically indicates site‑specific factors:
- Content approval/draft visibility or item‑level permissions hiding items for non‑approvers
- List view threshold (5,000 items) affecting un‑indexed filters
- Page/template differences (modern vs. classic,
NoScript/customscript) or SPFx quirks on classic publishing pages.
First of all, kindly confirm visibility/permissions, then rule out throttling, and finally validate page/template capabilities. Apply the minimal fix per finding.
Check content approval & draft visibility: In the failing list’s Versioning Settings, review Require content approval and Draft Item Security. If drafts are restricted to approvers, non‑approvers see zero results.
Validate effective permissions: Use REST on the list: /_api/web/lists/getbytitle('<List>')/EffectiveBasePermissions and interpret with SP.BasePermissions.has(SP.PermissionKind.viewListItems).
Avoid list throttling: Index columns used in $filter/CAML <Where>, keep queries under 5,000 items, and page results; avoid unbounded RecursiveAll.
Stabilize rendering across templates/pages: Test on a modern site page vs. classic publishing page; check NoScript/custom script (DenyAddAndCustomizePages) and ensure assets/CDN paths are reachable.
Diagnostic hygiene (optional but helpful): Add Cache-Control: no-cache to GETs and use ETags (If-Match/If-None-Match) to avoid stale reads/writes during testing.
Additionally, I think you can try the PowerShell approaches below to see it if can fulfill your concern:
Connect-SPOService -Url https://<tenant>-admin.sharepoint.com
$siteUrl = "https://<tenant>.sharepoint.com/sites/<SiteName>"
$listName = "YourList"
# Load PnP module
Connect-PnPOnline -Url $siteUrl -Interactive
# Get list settings
$list = Get-PnPList -Identity $listName
$list.EnableModeration # Shows if content approval is enabled
# Update Draft Item Security to allow readers
Set-PnPList -Identity $listName -DraftVersionVisibility Reader
Link references:
https://pnp.github.io/powershell/cmdlets/Set-PnPListItem.html
https://learn.microsoft.com/en-us/sharepoint/allow-or-prevent-custom-script
Hope my answer will help you, for any further concern, kindly let me know in the comment section
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.