[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[X] Support request
Expected Behavior
Current Behavior
node_modules/.bin/md-seed run --dropdb
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: md-seed-config.js
require() of ES modules is not supported.
require() of md-seed-config.js from node_modules/mongoose-data-seed/dist/lib/config.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename md-seed-config.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from package.json.
at Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Object.newLoader [as .js] (node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.loadUserConfig (node_modules/mongoose-data-seed/dist/lib/config.js:127:12)
at run (node_modules/mongoose-data-seed/dist/lib/commands/run/run.js:36:23)
at _default (node_modules/mongoose-data-seed/dist/lib/commands/run/index.js:33:27)
at runCommand (node_modules/mongoose-data-seed/dist/lib/commands/helpers.js:79:10) {
code: 'ERR_REQUIRE_ESM'
}
I'm submitting a…
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce (for bugs)
Environment