octobercms/october · error · Error
Inspector title is a required string
Error message
Inspector title is a required string
What it means
InspectorHost.showModal() opens the Inspector modal and validates every argument up front; the first check requires a non-empty string `title`, which becomes the modal heading. A missing, non-string, or empty title throws synchronously before any UI is mounted — a nameless modal is always a caller bug, not a runtime condition.
Source
Thrown at modules/backend/vuecomponents/inspector/assets/js/classes/host.js:4
export class InspectorHost {
showModal(title, obj, dataSchema, uniqueId, options, parentObj) {
if (typeof title !== 'string' || !title.length) {
throw new Error('Inspector title is a required string');
}
if (typeof obj !== 'object') {
throw new Error('Inspector Object must be an object');
}
if (parentObj !== undefined && typeof parentObj !== 'object') {
throw new Error('Inspector Parent Object must be an object');
}
if (!Array.isArray(dataSchema)) {
throw new Error('Inspector data schema must be an array');
}
if (typeof uniqueId !== 'string' || !uniqueId.length) {
throw new Error('Inspector unique key is a required string');
}
View on GitHub (pinned to b608633a7e)
Solutions
- Pass a non-empty string as the first argument.
- Default computed titles: showModal(title || 'Properties', ...).
- If the title comes from localization, fix or fall back for the missing translation key.
Example fix
// before host.showModal(this.config.title, obj, schema, uniqueId); // after host.showModal(this.config.title || 'Properties', obj, schema, uniqueId);
Defensive patterns
Strategy: validation
Validate before calling
const modalTitle = typeof title === 'string' && title.length ? title : 'Properties'; host.showModal(modalTitle, obj, schema, uniqueId);
Type guard
function isInspectorTitle(value) {
return typeof value === 'string' && value.length > 0;
} Prevention
- Default computed/config titles with a visible fallback
- Keep showModal call sites in one helper so argument rules are checked once
When it happens
Trigger: Calling showModal(undefined, obj, schema, id) or showModal('', obj, schema, id) — e.g. a config-driven title key that is absent, a translation key that resolved to empty, or arguments passed in the wrong order.
Common situations: Custom plugin JavaScript opening the inspector modal programmatically; refactoring from an inline inspector (where the title lives in the schema) to showModal and forgetting the now-explicit title argument; data-driven UIs where the title element is optional.
Understand the failure class
Background: Invalid argument type errors: "must be of type string", "expected X, got Y", and ERR_INVALID_ARG_TYPE explained — this error's family across 15 libraries.
Related errors
- Inspector Object must be an object
- Inspector Parent Object must be an object
- Inspector data schema must be an array
- Inspector unique key is a required string
- getDynamicOptionsExtraData must return an object
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/ebcb40d683d065cb.
Report an issue: GitHub.