Giter Site home page Giter Site logo

Comments (5)

antonkomarev avatar antonkomarev commented on August 28, 2024 1

I've added plugin:

"plugins": [
  "add-module-exports"
]

Issue replaced with another one:

TypeError: Class constructor Seeder cannot be invoked without 'new'

I've modified preset and everything seems to work now:

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "current"
        }
      }
    ]
  ],
  "plugins": [
    "add-module-exports"
  ]
}

Thank for the help @sharvit!

I don't understand difference between @babel/preset-env & @babel/env, but first one works in my case.

from mongoose-data-seed.

antonkomarev avatar antonkomarev commented on August 28, 2024

This issue could be related to this comment: #8 (comment)

from mongoose-data-seed.

sharvit avatar sharvit commented on August 28, 2024

Thank you for submitting an issue @antonkomarev

Any chance you can supply an environment/repository that showcases the issue?
It might help in this case so I can reproduce the error.

Some directions you can try:

  1. Upgrading to node-12 (AFAIK node-11 is not stable)
  2. Try downgrading mongoose-data-seed version to version 2.1.1 or 2.0.1, it might give us a clue if we the new version is broke.

Thanks

from mongoose-data-seed.

antonkomarev avatar antonkomarev commented on August 28, 2024

I've tried to downgrade to 2.1.1 & 2.0.1 but no luck, issue is in place.

The only difference in error output in 2.0.1:

TypeError: Seeder is not a constructor
    at MdSeedRunner._callee5$ (/home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:334:26)
    at tryCatch (/home/test-app/node_modules/regenerator-runtime/runtime.js:45:40)
    at Generator.invoke [as _invoke] (/home/test-app/node_modules/regenerator-runtime/runtime.js:271:22)
    at Generator.prototype.(anonymous function) [as next] (/home/test-app/node_modules/regenerator-runtime/runtime.js:97:21)
    at asyncGeneratorStep (/home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:24:103)
    at _next (/home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:26:194)
    at /home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:26:364
    at new Promise (<anonymous>)
    at MdSeedRunner.<anonymous> (/home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:26:97)
    at MdSeedRunner._runSeeder (/home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:370:28)
    at MdSeedRunner._callee4$ (/home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:281:29)
    at tryCatch (/home/test-app/node_modules/regenerator-runtime/runtime.js:45:40)
    at Generator.invoke [as _invoke] (/home/test-app/node_modules/regenerator-runtime/runtime.js:271:22)
    at Generator.prototype.(anonymous function) [as next] (/home/test-app/node_modules/regenerator-runtime/runtime.js:97:21)
    at asyncGeneratorStep (/home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:24:103)
    at _next (/home/test-app/node_modules/mongoose-data-seed/dist/lib/core/md-seed-runner.js:26:194)

Repository where I'm trying to start using your package is proprietary, so I can't share it, but will try to create a public sandbox if there will be no solution found.

from mongoose-data-seed.

antonkomarev avatar antonkomarev commented on August 28, 2024

Upgrade node to v12.8.1 didn't help too.

from mongoose-data-seed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.