Code Monkey home page Code Monkey logo

Comments (4)

thosakwe avatar thosakwe commented on June 12, 2024

I don't think faker allows you to invoke functions like that. Instead, use a function:

const faker = require('faker');

const seederConfig = {
  services: [
    {
      path: 'markets',
      count: 2,
      template: {
        name: () => faker.lorem.words(3),
        slug: () => faker.lorem.words(1)
      }
    }
  ]
};

from feathers-seeder.

SharadKumar avatar SharadKumar commented on June 12, 2024

Thats not the problem, it made no difference with this approach of invoking. I could see faker working with previous approach on console, but data is not persisting when called by seeder and fails silently.
So it continues to fail even after I tried above.

from feathers-seeder.

thosakwe avatar thosakwe commented on June 12, 2024

Not sure the problem is within the seeder. This package just calls remove (unless you tell it not to), then generates data and calls create.

The seeding function returns a Promise that you can catch; it shouldn't fail silently.

Also, I have no experience with nuxt.js whatsoever. I hadn't heard of it until seeing this issue.

Try running the seed with "DEBUG" in your environment set to "feathers-seeder".

from feathers-seeder.

SharadKumar avatar SharadKumar commented on June 12, 2024

Thanks for opening the issue @thosakwe

In order to simplify for you to see the issue, I forked and prototyped the problem. I used default Nedb as well as Postgres (in use on my project)... and I can see the seeding worked with Nedb (markets model) but not Postgres (products model).

https://github.com/SharadKumar/feathers-nuxt/commit/951fe6403db558eafe931c261543ad256702ecfb

Any help is sincerely appreciated. Really keen to make seeder work, cause I am using Postman for now.

from feathers-seeder.

Related Issues (19)

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.