{"record":{"id":"f8ab7a3cd1f82870","repo":"plotly/plotly.js","slug":"no-argument-passed-to-plotly-register","errorCode":null,"errorMessage":"No argument passed to Plotly.register.","messagePattern":"No argument passed to Plotly\\.register\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/registry.js","lineNumber":63,"sourceCode":" *                          generally the keys should be the literal input strings, but\n *                          if default translations are provided you can use any string as a key.\n *  - format {object} : a `d3.locale` format specifier for this locale\n *                      any omitted keys we'll fall back on en-US.\n *\n *  A valid `moduleType: 'component'` module has fields:\n *  - name {string} : the component name, used it with Register.getComponentMethod()\n *                    to employ component method.\n *\n *  A valid `moduleType: 'apiMethod'` module has fields:\n *  - name {string} : the api method name.\n *  - fn {function} : the api method called with Register.call();\n *\n */\nexports.register = function register(_modules) {\n    exports.collectableSubplotTypes = null;\n\n    if(!_modules) {\n        throw new Error('No argument passed to Plotly.register.');\n    } else if(_modules && !Array.isArray(_modules)) {\n        _modules = [_modules];\n    }\n\n    for(var i = 0; i < _modules.length; i++) {\n        var newModule = _modules[i];\n\n        if(!newModule) {\n            throw new Error('Invalid module was attempted to be registered!');\n        }\n\n        switch(newModule.moduleType) {\n            case 'trace':\n                registerTraceModule(newModule);\n                break;\n            case 'component':\n                registerComponentModule(newModule);\n                break;","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/registry.js#L45-L81","documentation":"Guard at the top of Plotly.register: the function expects one module or a non-empty array of partial-bundle modules to add to the registries (traces, transforms, components, locales, apiMethods). The throw fires when register is called with no argument at all (undefined/null), which would otherwise cause a TypeError inside the module loop.","triggerScenarios":"Thrown at src/registry.js:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the module(s) to register, e.g. Plotly.register([require('plotly.js/lib/scatter3d')]).","Check that the import used to fetch the module actually resolved (a failed require yields undefined).","Register an array of modules when loading several partial-bundle pieces."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314","analyzedAt":"2026-09-02T22:03:39.906Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}