octobercms/october · error · Error
Cannot create Inspector container wrapper without a…
Error message
Cannot create Inspector container wrapper without a container element.
What it means
Constructor guard for the container wrapper: options.container must supply the DOM element that hosts the Inspector surface. Instantiating the wrapper without that option cannot proceed, so it throws immediately before Base initialization.
Solutions
- Pass a valid container element via the data-inspector-container attribute or options.container
- Ensure the container element exists in the DOM before initializing the Inspector
- If embedding dynamically, create/attach the container node first
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/backend/assets/foundation/controls/inspector/inspector.wrapper.container.js:14 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/f4f9274099838d09.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/assets/foundation/controls/inspector/inspector.wrapper.container.js:14
/*
* Inspector container wrapper.
*/
+function ($) { "use strict";
// CLASS DEFINITION
// ============================
var Base = $.oc.inspector.wrappers.base,
BaseProto = Base.prototype
var InspectorContainer = function($element, surface, options) {
if (!options.container) {
throw new Error('Cannot create Inspector container wrapper without a container element.')
}
this.surfaceContainer = null
Base.call(this, $element, surface, options)
}
InspectorContainer.prototype = Object.create(BaseProto)
InspectorContainer.prototype.constructor = Base
InspectorContainer.prototype.init = function() {
this.registerHandlers()
BaseProto.init.call(this)
}
InspectorContainer.prototype.dispose = function() {
this.unregisterHandlers()View on GitHub (pinned to b608633a7e)