{"record":{"id":"7e247661f06a4d68","repo":"plotly/plotly.js","slug":"component-module-name-must-be-a-string","errorCode":null,"errorMessage":"Component module *name* must be a string.","messagePattern":"Component module \\*name\\* must be a string\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/registry.js","lineNumber":252,"sourceCode":"        return;\n    }\n\n    // relayout array handling will look for component module methods with this\n    // name and won't find them because this is a subplot module... but that\n    // should be fine, it will just fall back on redrawing the plot.\n    findArrayRegexps(_module);\n\n    // not sure what's best for the 'cartesian' type at this point\n    exports.subplotsRegistry[plotType] = _module;\n\n    for(var componentName in exports.componentsRegistry) {\n        mergeComponentAttrsToSubplot(componentName, _module.name);\n    }\n}\n\nfunction registerComponentModule(_module) {\n    if(typeof _module.name !== 'string') {\n        throw new Error('Component module *name* must be a string.');\n    }\n\n    var name = _module.name;\n    exports.componentsRegistry[name] = _module;\n\n    if(_module.layoutAttributes) {\n        if(_module.layoutAttributes._isLinkedToArray) {\n            pushUnique(exports.layoutArrayContainers, name);\n        }\n        findArrayRegexps(_module);\n    }\n\n    for(var traceType in exports.modules) {\n        mergeComponentAttrsToTrace(name, traceType);\n    }\n\n    for(var subplotName in exports.subplotsRegistry) {\n        mergeComponentAttrsToSubplot(name, subplotName);","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/registry.js#L234-L270","documentation":"Guard in registerComponentModule (called from Plotly.register for modules with moduleType 'component'). A component module must carry a string name, because that name is the key under which the module is stored in componentsRegistry and is how relayout array handling resolves component methods (via Register.getComponentMethod). The throw fires when a registered component module has a missing or non-string name field.","triggerScenarios":"Thrown at src/registry.js:252 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a string name field to the component module, e.g. {moduleType:'component', name:'rangeSlider', ...}.","Check for typos such as moduleName instead of name.","Verify the module object passed to Plotly.register matches the documented component module schema."],"exampleFix":null,"handlingStrategy":"type-guard","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"}