mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 17:24:12 +00:00
Merge branch 'develop'
This commit is contained in:
commit
ec0096cb2a
1 changed files with 18 additions and 12 deletions
|
|
@ -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
|
## 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
|
## Environment
|
||||||
- **Payload Version:** 3.68.4
|
- **Payload Version:** 3.68.4
|
||||||
|
|
@ -92,29 +92,35 @@ When running in development or checking server logs, the actual error is:
|
||||||
## Additional Context
|
## Additional Context
|
||||||
|
|
||||||
### What works:
|
### What works:
|
||||||
- Admin panel without custom views
|
- Admin panel WITHOUT any custom components (completely empty `admin.components` or omitted entirely)
|
||||||
- Components in `afterNavLinks` (e.g., TenantBreadcrumb)
|
|
||||||
- Components in `beforeNavLinks` (e.g., DashboardNavLink)
|
|
||||||
|
|
||||||
### What fails:
|
### 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:
|
### Investigation findings:
|
||||||
- The error originates from `path-to-regexp` (version 6.3.0)
|
- The error originates from `path-to-regexp` (version 6.3.0)
|
||||||
- The error occurs during route matching in `handleEndpoints.js`
|
- 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
|
- 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`)
|
- 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
|
### Workaround
|
||||||
Disable custom views and use only `afterNavLinks`/`beforeNavLinks` components:
|
Completely disable ALL custom components:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
admin: {
|
admin: {
|
||||||
components: {
|
user: Users.slug,
|
||||||
afterNavLinks: ['@/components/admin/TenantBreadcrumb#TenantBreadcrumb'],
|
// ALL custom components disabled - triggers path-to-regexp error with multi-tenant plugin
|
||||||
// views disabled due to bug
|
// components: {
|
||||||
},
|
// afterNavLinks: ['...'],
|
||||||
|
// beforeNavLinks: ['...'],
|
||||||
|
// views: { ... },
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue