Azure / Azure/api-management-developer-portal
Cannot read properties of undefined (reading 'allowedTenants')
- Dominant language
- TypeScript
- Stars
- 545
- Forks
- 360
- PR merge metrics
- No merged PRs in 30d
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](http://aka.ms/apimso). Feature requests can be raised [on the Azure Feedback Forum](https://aka.ms/apimwish).
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 || [];
Contributor guide
No contributing guide indexed for this repository
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.
Assessment
- Tech stack
- azure, typescript
- Domain
- authentication, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100