You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using sequelize-cli in a project having "type": "module" with a .js config file path (via .sequelizerc), commands(even npx sequeliize-cli --version) break with follwing error trace
ReferenceError: require is not defined in ES module scope, you can use import instead
at file:///Users/rpsingh/dev/sif_ms/.sequelizerc:1:14
at ModuleJobSync.runSync (node:internal/modules/esm/module_job:673:37)
npx sequelize-cli --version
file:///Users/rpsingh/dev/sif_ms/.sequelizerc:1
const path = require('path');
^
ReferenceError: require is not defined in ES module scope, you can use import instead
at file:///Users/rpsingh/dev/sif_ms/.sequelizerc:1:14
at ModuleJobSync.runSync (node:internal/modules/esm/module_job:673:37)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:350:47)
at loadESMFromCJS (node:internal/modules/cjs/loader:1752:24)
at Module._compile (node:internal/modules/cjs/loader:1916:5)
at Object..js (node:internal/modules/cjs/loader:2074:10)
at Module.load (node:internal/modules/cjs/loader:1656:32)
at Module._load (node:internal/modules/cjs/loader:1448:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:261:19)
at Module.require (node:internal/modules/cjs/loader:1679:12)
Node.js v26.5.0
Environment
Sequelize-cli version: 6.6.5
Node.js version: 26.5.0
If TypeScript related: N/A
Database & Version: N/A
Connector library & Version: N/A
More info
This bug is not occuring in node version 24 or 25.
Activity