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

Bug: Seeder crash #498

Closed
bidossessi opened this issue Mar 4, 2023 · 7 comments
Closed

Bug: Seeder crash #498

bidossessi opened this issue Mar 4, 2023 · 7 comments

Comments

@bidossessi
Copy link

bidossessi commented Mar 4, 2023

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
@tada5hi
Copy link
Owner

tada5hi commented Mar 5, 2023

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

@bidossessi
Copy link
Author

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

@tada5hi
Copy link
Owner

tada5hi commented Mar 5, 2023

That would be great 😊

@tada5hi
Copy link
Owner

tada5hi commented Mar 6, 2023

maybe i should make the documentation more detailed or allow non default exports 🤔 .

@bidossessi
Copy link
Author

bidossessi commented Mar 6, 2023

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. 🙏

@bidossessi
Copy link
Author

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

@tada5hi
Copy link
Owner

tada5hi commented Mar 13, 2023

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.

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