Cannot read properties of undefined (reading 'allowedTenants')

Open Beginner friendly
#2,874 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
azure, typescript

Research direction

Start in signinSocialViewModelBinder.ts, where the issue identifies the allowedTenants access, and reproduce the failure with npm run publish using the self-hosted portal instructions. Trace the Sign in page rendering path and verify the publishing command completes without the TypeError and populates dist/website with the portal content.

Written by the indexing model from the issue text.

Description

[!IMPORTANT]
PLEASE DO NOT CREATE ISSUES RELATED TO MANAGED DEVELOPER PORTAL IN THIS REPOSITORY. Issues related to "Managed developer portal" will be closed automatically. Managed developer portal issues should be created directly in Azure Support + Troubleshooting in Azure portal. Contact Azure support (or) submit a post on Stack Overflow. Feature requests can be raised on the Azure Feedback Forum.

Every self-hosted developer bug report should have precise description and reproduction steps; console traces (or) source code references are appreciated.

Bug description

Issue with publishing the selfhsoted website

Reproduction steps

  1. Simply follow the document https://learn.microsoft.com/en-us/azure/api-management/developer-portal-self-host
  2. Run npm run publish to publish the website locally
  3. See error below
    Error: Unable to complete publishing. Error: Unable to complete pages publishing. Error: Unable to publish page "Sign in": Error: Unable to render page "Sign in - Microsoft Azure API Management - developer portal": Error: Unable to render page: TypeError: Cannot read properties of undefined (reading 'allowedTenants')
  4. Content not published correctly under dist/website folder.

Expected behavior

Run npm run should be able to Publish the portal locally and the content is published to the dist/website folder.

Is self-hosted portal?

Yes

[!WARNING]
"Managed developer portal issues" will be closed automatically. See above for more details.

Release tag or commit SHA (if using self-hosted version)

Release 2.34

API Management service name

apim-one-shailesh

Environment

  • Operating system: [e.g., iOS]
  • Browser: [e.g., Google Chrome, Safari]
  • Version: [e.g., 22]

Additional context

Issue seems with allowedTenants variable under signinSocialViewModelBinder.ts file
Fix add the null check here > const tenants = aadIdentityProvider?.allowedTenants || [];

Dominant language
TypeScript
Stars
545
Forks
359
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/api-management-developer-portal

All issues in Azure/api-management-developer-portal

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.