-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Can't generate migrations in test project #9760
Comments
Hi @sharikovvladislav ! If you use ESM type imports you can try running it with Here is migration generation command for your case:
|
We could fix this problem by using typeorm-ts-node-commonjs like mentioned in the docs. |
@alexander-kraev-snyk So I do that:
And then I get:
|
It also breaks if I do: |
Issue description
I have created test project with a playground, like the docs states. After that I am trying to generate migrations, so I can run them on a server later, I am getting the error during migrations generation.
Expected Behavior
Actual Behavior
An error happens during the CLI command execution.
Steps to reproduce
Here is the console output. Init -> generate -> generate with a datasource specified
My Environment
Additional Context
I have tried
typeorm-esm
(I just accidentally foundtypeorm-ts-node-esm
in docs and assumed there should betypeorm-esm
module.I have tried
node --experimental-modules ./node_modules/.bin/typeorm migration:generate PostRefactoring -d ./src/data-source.ts
. The same result as in the "Actual result" section.Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
UPD:
The text was updated successfully, but these errors were encountered: