docs: update bug report - all custom components affected

afterNavLinks also triggers the error in production builds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Martin Porwoll 2025-12-20 15:08:27 +00:00
parent 85b7ddd7bd
commit b62c559cad

View file

@ -1,7 +1,7 @@
# Bug Report: Custom Admin Views cause TypeError with path-to-regexp
# Bug Report: Custom Admin Components cause TypeError with path-to-regexp
## Summary
Custom admin views registered via `admin.components.views` cause a `TypeError: Missing parameter name at 5` error from path-to-regexp when used together with `@payloadcms/plugin-multi-tenant`.
**ALL** custom admin components registered via `admin.components` cause a `TypeError: Missing parameter name at 5` error from path-to-regexp when used together with `@payloadcms/plugin-multi-tenant`. This includes `views`, `afterNavLinks`, and `beforeNavLinks`.
## Environment
- **Payload Version:** 3.68.4
@ -92,29 +92,35 @@ When running in development or checking server logs, the actual error is:
## Additional Context
### What works:
- Admin panel without custom views
- Components in `afterNavLinks` (e.g., TenantBreadcrumb)
- Components in `beforeNavLinks` (e.g., DashboardNavLink)
- Admin panel WITHOUT any custom components (completely empty `admin.components` or omitted entirely)
### What fails:
- ANY custom view registered via `admin.components.views`, even the simplest component without any dependencies
- ANY custom component registered via `admin.components`, including:
- `views` - custom admin views
- `afterNavLinks` - components after nav links (e.g., TenantBreadcrumb)
- `beforeNavLinks` - components before nav links
- Even the simplest component without any dependencies triggers the error
### Investigation findings:
- The error originates from `path-to-regexp` (version 6.3.0)
- The error occurs during route matching in `handleEndpoints.js`
- The error message "Missing parameter name at 5" suggests an invalid route pattern like `/:` is being generated somewhere
- This happens regardless of the view path used (tested with `/dashboard`, `/tenant-dashboard`, `/test-dashboard`)
- The issue appears to be triggered by the combination of custom views and the multi-tenant plugin
- The issue appears to be triggered by the combination of ANY custom component and the multi-tenant plugin
- Initially appeared to work in development but fails consistently in production builds
### Workaround
Disable custom views and use only `afterNavLinks`/`beforeNavLinks` components:
Completely disable ALL custom components:
```typescript
admin: {
components: {
afterNavLinks: ['@/components/admin/TenantBreadcrumb#TenantBreadcrumb'],
// views disabled due to bug
},
user: Users.slug,
// ALL custom components disabled - triggers path-to-regexp error with multi-tenant plugin
// components: {
// afterNavLinks: ['...'],
// beforeNavLinks: ['...'],
// views: { ... },
// },
},
```