tada5hi/typeorm-extension

Bug: Seeder crash

bidossessi opened this issue ยท 7 comments

Versions

  • Node: v16.19.0
  • OS: macOS Monterey (Intel)
  • lib version: 2.5.2

Steps to reproduce

Configure a library for seeding.

import 'reflect-metadata'
import { DataSource } from 'typeorm'

import { runSeeders } from 'typeorm-extension'
import options from './dsConfig'

const dataSource = new DataSource(options)
console.log('Running Seeder!')

dataSource.initialize().then(async () => {
  await dataSource.synchronize(true)
  await runSeeders(dataSource)
  process.exit()
})

What is Expected?

Database is seeded

What is actually happening?

Crash:

/Users/stanislas/Documents/Projects/qanoune/backend/node_modules/typeorm-extension/dist/seeder/module.js:97
    const clazz = new seeder();
                  ^
TypeError: seeder is not a constructor

Mhhh, can it be that in the seeder file, the class is not presented as a default export to the outside world?

That just might be it. I'll check again and get back to you ASAP.

That would be great ๐Ÿ˜Š

maybe i should make the documentation more detailed or allow non default exports ๐Ÿค” .

Hi. I'm really sorry about the delay. IRL is a bit hectic and I don't have much time to get back to the project that I wanted to use this library with.

You can leave this on the backburner for now. I'll do my best to reproduce this weekend. If I can't then I'll simply close this and hope you'll forgive the pointless noise. ๐Ÿ™

I was not able to reproduce the issue.
I'm closing this.

Hi. I'm really sorry about the delay. IRL is a bit hectic and I don't have much time to get back to the project that I wanted to use this library with.

You can leave this on the backburner for now. I'll do my best to reproduce this weekend. If I can't then I'll simply close this and hope you'll forgive the pointless noise. ๐Ÿ™

Don't worry ๐Ÿ˜‡ . I am always happy to receive feedback, ideas or suggestions for improvement ๐Ÿ˜Š . It's always nice when a project evolves through the community and covers more requirements.