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

fix: broken CLI in ESM projects since version 0.3 #8773

Merged
merged 2 commits into from Mar 22, 2022

Conversation

giladgd
Copy link
Contributor

@giladgd giladgd commented Mar 21, 2022

Description of change

Using the CLI in ESM projects is broken in version 0.3.1, this PR fixes that.
The CLI currently tries to require( ... ) the data-source.ts file of the project regardless of the project type (CommonJS/ESM), the fix is to use the importOrRequireFile function instead.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier formatting
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change - This is problematic to test from within the module itself
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

@pleerock pleerock merged commit 97699e8 into typeorm:master Mar 22, 2022
@pleerock
Copy link
Member

thanks a lot

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

Successfully merging this pull request may close these issues.

None yet

2 participants