octobercms/october · error · Error

The $.oc.table.datasource namespace is not defined. Make…

Error message

The $.oc.table.datasource namespace is not defined. Make sure that the table.datasource.base.js script is loaded.

What it means

Sentinel namespace check at the top of the table server data source IIFE: $.oc.table exists but $.oc.table.datasource does not, meaning the shared base data source file table.datasource.base.js was not loaded before this derived data source.

Solutions

  1. Load table.datasource.base.js before table.datasource.server.js
  2. Use the framework's asset bundle ordering
  3. Verify table.datasource.base.js loaded without errors
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/widgets/table/assets/js/table.datasource.server.js:13 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/669a9b8ea702c41f. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/widgets/table/assets/js/table.datasource.server.js:13

/*
 * Server memory data source for the table control.
 */
+function ($) { "use strict";

    // NAMESPACE CHECK
    // ============================

    if ($.oc.table === undefined)
        throw new Error("The $.oc.table namespace is not defined. Make sure that the table.js script is loaded.");

    if ($.oc.table.datasource === undefined)
        throw new Error("The $.oc.table.datasource namespace is not defined. Make sure that the table.datasource.base.js script is loaded.");

    // CLASS DEFINITION
    // ============================

    var Base = $.oc.table.datasource.base,
        BaseProto = Base.prototype

    var Server = function(tableObj) {
        Base.call(this, tableObj)

        var dataString = tableObj.getElement().getAttribute('data-data')

        if (dataString === null || dataString === undefined)
            throw new Error('The required data-data attribute is not found on the table control element.')

        this.data = JSON.parse(dataString)
    };

View on GitHub (pinned to b608633a7e)