Get to know MDN better
The JavaScript exception "must call super constructor before using 'this' in derived class constructor" occurs when the super() is not called for a given derived class constructor, and the derived constructor tries to access the value of this, or the derived constructor has already returned and the return value is not an object.
The super() call can only be called at most once for each new call to a derived class constructor. Often, you need to call it exactly once, because if you don't call it, the parent constructor cannot initialize the value of this, so you cannot access this in the derived constructor and the this is not considered a valid constructed object (and throws if the derived constructor completes in this state). The way around it is to return an object from the derived class constructor, in which case the object returned will be used as the constructed object instead of this, allowing you to not call super(). This is rarely done though.
This page was last modified on Jul 8, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.