What you are doing?
Trying to load models with models/index.js doesn't work with ES6 modules activated with "type": "module"
const basename = path.basename(__filename);
// {...}
const model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes);
Variables like __filename and __dirname don't work anymore with modules.
What do you expect to happen?
There should be an option to choose between Modules or CommonJS.
What is actually happening?
There's only CommonJS support.
What you are doing?
Trying to load models with models/index.js doesn't work with ES6 modules activated with
"type": "module"Variables like
__filenameand__dirnamedon't work anymore with modules.What do you expect to happen?
There should be an option to choose between Modules or CommonJS.
What is actually happening?
There's only CommonJS support.