{"record":{"id":"bb82bd343532e91e","repo":"emberjs/ember.js","slug":"you-must-pass-both-the-owner-and-args-to-super-i-bb82bd","errorCode":null,"errorMessage":"You must pass both the owner and args to super() in your component: ${this.constructor.name}. You can pass them directly, or use ...arguments to pass all arguments through.","messagePattern":"You must pass both the owner and args to super\\(\\) in your component: (.+?)\\. You can pass them directly, or use \\.\\.\\.arguments to pass all arguments through\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@glimmer/component/src/index.ts","lineNumber":423,"sourceCode":"\n  ## `isDestroying`\n\n  A boolean flag to tell if the component is in the process of destroying. This is set to\n  true before `willDestroy` is called.\n\n  ## `isDestroyed`\n  A boolean to tell if the component has been fully destroyed. This is set to true\n  after `willDestroy` is called.\n\n  @module @glimmer/component\n  @public\n*/\nexport default class Component<S = unknown> extends _GlimmerComponent<S> {\n  constructor(owner: Owner, args: Args<S>) {\n    super(owner, args);\n\n    if (DEBUG && !(owner !== null && typeof owner === 'object')) {\n      throw new Error(\n        `You must pass both the owner and args to super() in your component: ${this.constructor.name}. You can pass them directly, or use ...arguments to pass all arguments through.`\n      );\n    }\n\n    setOwner(this, owner);\n  }\n}\n\nsetComponentManager((owner: Owner) => {\n  return new GlimmerComponentManager(owner);\n}, Component);\n","sourceCodeStart":405,"sourceCodeEnd":435,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/component/src/index.ts#L405-L435","documentation":"The re-exported Component wrapper in @glimmer/component validates that the owner passed through super() is a non-null object (DEBUG only). Even though TypeScript types the owner, a null/undefined owner slips through at runtime when a component is constructed outside the rendering system.","triggerScenarios":"Manually instantiating a component class with `new MyComponent()` or `new MyComponent(null, {})` outside the app renderer; tests constructing components directly; calling super() with a dropped owner argument.","commonSituations":"Unit tests instantiating components directly instead of rendering them; misuse in addon code creating components imperatively; migration where the owner lookup was removed.","solutions":["Render the component through the normal template/invocation path so the framework supplies the owner","If constructing in tests, use a render helper (e.g. renderElectronic or the test harness) rather than `new`","Ensure super() receives the owner as the first argument","Confirm setOwner/application bootstrapping is complete before component creation"],"exampleFix":"// before\nlet comp = new MyComponent(null, {});\n// after\nawait render(hbs`<MyComponent />`);","handlingStrategy":"validation","validationCode":"if (owner === null || typeof owner !== 'object') {\n  throw new Error('Owner required: render the component through the framework instead of constructing it directly');\n}","typeGuard":"function isOwner(o) { return o !== null && typeof o === 'object' && typeof o.lookup === 'function'; }","tryCatchPattern":"try {\n  new MyComponent(owner, args);\n} catch (e) {\n  if (String(e.message).includes('owner and args')) {\n    // fall back to rendering through the test harness\n  } else { throw e; }\n}","preventionTips":["Never instantiate components with `new` outside the renderer; use render helpers","In tests use the app's rendering test harness so the owner is provided","Confirm setOwner was applied to any manually resolved objects"],"tags":["glimmer","ember","owner","constructor","debug"],"backgroundTag":"missing-super-arguments","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}