mongoosewithoutes6 here we didn't add string "type": "module" in package.json so, don't use es6 module if TypeError: Blog is not a Constructor It should be module.exports (doc), not module.export: (() => {})(); Immediately invoked arrow function execution