{"record":{"id":"2cc9734a94599df3","repo":"videojs/video.js","slug":"component-componentclassname-does-not-exist","errorCode":null,"errorMessage":"Component ${componentClassName} does not exist","messagePattern":"Component (.+?) does not exist","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/js/component.js","lineNumber":629,"sourceCode":"  addChild(child, options = {}, index = this.children_.length) {\n    let component;\n    let componentName;\n\n    // If child is a string, create component with options\n    if (typeof child === 'string') {\n      componentName = toTitleCase(child);\n\n      const componentClassName = options.componentClass || componentName;\n\n      // Set name through options\n      options.name = componentName;\n\n      // Create a new object & element for this controls set\n      // If there's no .player_, this is a player\n      const ComponentClass = Component.getComponent(componentClassName);\n\n      if (!ComponentClass) {\n        throw new Error(`Component ${componentClassName} does not exist`);\n      }\n\n      // data stored directly on the videojs object may be\n      // misidentified as a component to retain\n      // backwards-compatibility with 4.x. check to make sure the\n      // component class can be instantiated.\n      if (typeof ComponentClass !== 'function') {\n        return null;\n      }\n\n      component = new ComponentClass(this.player_ || this, options);\n\n    // child is a component instance\n    } else {\n      component = child;\n    }\n\n    if (component.parentComponent_) {","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/videojs/video.js/blob/c3a7e0e6d20cf5400c9afbee29965fe4dff393c2/src/js/component.js#L611-L647","documentation":"Thrown by Component.getChild/registerChild path when Component.getComponent(componentClassName) returns a falsy value during child instantiation. Video.js looks up every child component by TitleCased name in its internal Component.components_ registry; if no class was registered under that name (or the registered value is not a constructable function), it bails with this error. It almost always means a required component was never registered, was tree-shaken out, or the name supplied to addChild was misspelled.","triggerScenarios":"Calling player.addChild('Foo') or passing {children: ['Foo']} in options where 'Foo' was never registered via videojs.registerComponent('Foo', ...). Also triggered when componentClass option points at an unregistered class name, or when a custom build omits a component that another component references as a child.","commonSituations":"Custom/lean video.js builds that exclude default components; typo in a child name (e.g. 'ControllBar'); plugin that registers children but is loaded after the player is built; upgrading video.js where a default component was renamed.","solutions":["Verify the component name spelling and case — addChild expects the TitleCased registered name (e.g. 'ControlBar', not 'controlbar' or 'controlBar').","Register the component before constructing the player: videojs.registerComponent('Foo', FooComponent).","If using a custom build, ensure the component module is imported so it self-registers (side-effect import).","Pass the class directly via options.componentClass if the name lookup is ambiguous."],"exampleFix":"// before\nplayer.addChild('ControllBar');\n// after\nplayer.addChild('ControlBar');\n// or register your own\nvideojs.registerComponent('MyComp', MyComp);\nplayer.addChild('MyComp');","handlingStrategy":"validation","validationCode":"const Component = videojs.getComponent('Component');\nfunction canAddChild(name) {\n  return Boolean(Component.getComponent(videojs.getComponent(name) ? name : name));\n}\n// before addChild\nif (!videojs.getComponent(childName)) {\n  throw new Error(`Refusing to add unregistered child: ${childName}`);\n}","typeGuard":"const isRegisteredComponent = (name) =>\n  typeof name === 'string' && name.length > 0 &&\n  typeof videojs.getComponent(name) === 'function';","tryCatchPattern":null,"preventionTips":["Register all custom components at module load before any videojs() call.","In custom builds, side-effect-import every component you reference as a child.","Centralize child-name constants to avoid typos."],"tags":["component","registry","config","videojs"],"backgroundTag":null,"analyzedSha":"c3a7e0e6d20cf5400c9afbee29965fe4dff393c2","analyzedAt":"2026-08-13T04:20:15.471Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}