Error AtlasError Documentation and Resolution

JavaScript value is not a constructor

TypeError: x is not a constructor

JavaScript tried to instantiate a value with new, but that value is not constructable.

TypeError: x is not a constructorruntime
TypeError: x is not a constructor
  • New is being used on a function or value that is not constructable.
  • An import or require returned a different value than expected.
  • A method or object property was mistaken for a class or constructor.
  1. Log the value you are calling with new and confirm its actual type.
  2. Check module imports and default-vs-named import usage.
  3. Only use new with classes or constructable functions.
MDN: TypeError: x is not a constructor
JavaScript x is not a constructor: causes and fixes | Error Atlas