Named export ‘Types’ not found. The requested module ‘mongoose’ is a CommonJS module, which may not support all module.exports as named exports

TL;DR All you have to do is remove the curly braces from the Types. That should work. Just like this: import Types from ‘mongoose’ But the name does not matter. Explanation import Types from ‘mongoose’ works because we are importing the package’s default export (this is why the name we use does not matter). However, … Read more