CodewCaro.

TypeError: Class extends value undefined is not a constructor or null

Caroline Cah
Caroline Cah

This error typically happens in the context of a Node.js environment, like when you're using Yarn for package management and running tests. When you try to extend a class from something that is not a class constructor.


The most common cause is an incorrect import statement. Make sure that the class or module you're extending is properly exported and imported.


export default class MySuperClass { ... }

import MySuperClass from '../MySuperClass';

If you're using a third party dependency you need to go to their documentation and see if the property your trying to import is available to consume.

More posts