Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run seeders #98

Open
1 of 5 tasks
rochapablo opened this issue Oct 12, 2020 · 1 comment
Open
1 of 5 tasks

Not able to run seeders #98

rochapablo opened this issue Oct 12, 2020 · 1 comment

Comments

@rochapablo
Copy link

I'm submitting a…

  • Regression (a behavior that used to work and stopped working in a new release)
  • Bug report
  • Feature request
  • Documentation issue or request
  • 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'
}

Possible Solution

Steps to Reproduce (for bugs)

Environment

  • mongoose-data-seed version: 2.1.6
  • Node version: 14.13.1
  • NPM version: 6.14.8
  • Yarn version (if you use Yarn):
  • Operating system: Mac
  • Link to your project:
@jetonk
Copy link

jetonk commented Mar 29, 2022

Same here, I have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants