Short answer
If the stack trace points at your code, add new: new User(data), not User(data), and use (x) => new Row(x) where a function is expected. If it points at compiled output and appeared after a package update, your build targets ES5 while the package now ships real classes: set "target" to "ES2017" or later in tsconfig.json.
Why the class was called without new, and the fix
01
Calling a class like a function
“All class constructors must be called with new.” MDN, TypeError: class constructors must be invoked with 'new'
A class can only be constructed. Add new where it is created.
// wrong const user = User(data); // right const user = new User(data);02
A class passed where a function is expected
“However, class constructors are always constructors and cannot be called as normal functions.” MDN, TypeError: class constructors must be invoked with 'new'
rows.map(Row), a callback, or a factory option calls the class without new. Wrap it in a function that constructs it.
// wrong const items = rows.map(Row); // right const items = rows.map((r) => new Row(r));03
TypeScript compiling to ES5 and extending a real class
“Modern browsers support all ES6 features, so ES6 is a good choice.” TypeScript, TSConfig: target
With target ES5, class Child extends Base becomes a function that calls Base.call(this). If Base comes from a package that ships real ES2015+ classes, that call throws. Raise the target so your classes stay classes. Current Babel handles this case; a very old Babel (6) or a custom ES5 transform can fail the same way, so update it and drop IE-era targets.
// tsconfig.json { "compilerOptions": { "target": "ES2017" } }04
Old-style inheritance with Parent.call(this)
Pre-class code inherits with Parent.call(this, ...) and Object.create. Once Parent is rewritten as a class, that call throws. Convert the child to class Child extends Parent with super().
class Child extends Parent { constructor(name) { super(name); } }
Checked against the vendor’s docs on : MDN: TypeError: class constructors must be invoked with 'new'; TypeScript: TSConfig target.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
Related: “x is not a constructor” · JavaScript “x is not a function” · TypeScript “Type is not assignable to type”